From 2bad7ef97b69454c748799b2a020c31ac9adb573 Mon Sep 17 00:00:00 2001 From: HONG Yifan Date: Wed, 13 Aug 2025 18:52:49 +0000 Subject: [PATCH] fix: bootstrapping script to not use multiline f-strings With bootstrap_impl=system_python, after https://github.com/bazel-contrib/rules_python/pull/2607, host Python 3.6 and above is required because of the use of multiline f-strings. For maximum backwards compatibility (because this is a host dependency), do not use multiline f-strings. This issue naturally does not apply to bootstrap_impl=script because there are no host Python dependency. Link: https://github.com/bazel-contrib/rules_python/pull/2607 --- python/private/python_bootstrap_template.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/private/python_bootstrap_template.txt b/python/private/python_bootstrap_template.txt index a979fd4422..1eaa0483df 100644 --- a/python/private/python_bootstrap_template.txt +++ b/python/private/python_bootstrap_template.txt @@ -436,11 +436,11 @@ def _RunForCoverage(python_program, main_filename, args, env, unique_id = uuid.uuid4() rcfile_name = os.path.join(os.environ['COVERAGE_DIR'], ".coveragerc_{}".format(unique_id)) with open(rcfile_name, "w") as rcfile: - rcfile.write(f'''[run] + rcfile.write('''[run] relative_files = True source = \t{source} -''') +'''.format(source=source)) PrintVerboseCoverage('Coverage entrypoint:', coverage_entrypoint) # First run the target Python file via coveragepy to create a .coverage # database file, from which we can later export lcov.