From 9c1cb8e6df468a459783b49d59c60eee3cf83d4d Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Sun, 5 Oct 2025 19:49:34 +0900 Subject: [PATCH] Bump pyupgrade target to 3.10+ ... according to the versions currently supported. Change-Id: I2f907cb9ce28348236a0d7d062729a5bd6e4901a Signed-off-by: Takashi Kajinami --- .pre-commit-config.yaml | 2 +- tools/oslo_run_pre_release_tests | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0e81ebd..c8f61fd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -21,4 +21,4 @@ repos: rev: v3.20.0 hooks: - id: pyupgrade - args: [--py3-only] + args: [--py310-plus] diff --git a/tools/oslo_run_pre_release_tests b/tools/oslo_run_pre_release_tests index ced5eb2..a2be24a 100755 --- a/tools/oslo_run_pre_release_tests +++ b/tools/oslo_run_pre_release_tests @@ -127,7 +127,7 @@ def main(): lib_dir = os.getcwd() else: lib_dir = os.path.join(repo_root, 'openstack', lib_name) - print('testing {} in {}'.format(lib_name, lib_dir)) + print(f'testing {lib_name} in {lib_dir}') projects = set(conf.consumer) if not projects: @@ -155,7 +155,7 @@ def main(): # Make sure the lib being tested is set to the reference intended. if conf.ref != 'HEAD': if conf.verbose: - print('ensuring {} is updated to {}'.format(lib_name, conf.ref)) + print(f'ensuring {lib_name} is updated to {conf.ref}') subprocess.check_call( ['git', 'checkout', conf.ref], cwd=lib_dir, @@ -177,9 +177,9 @@ def main(): ).communicate() p_log_name = p.split('/')[-1].replace('.', '-') for e in conf.env: - log_name = 'cross-test-{}-{}.log'.format(p_log_name, e) + log_name = f'cross-test-{p_log_name}-{e}.log' with open(log_name, 'w') as log_file: - print('testing {} in {}, logging to {}'.format(e, p, log_name), + print(f'testing {e} in {p}, logging to {log_name}', end=' ') sys.stdout.flush() command = ['oslo_run_cross_tests', proj_dir, e]