diff --git a/bin/generate_schema.py b/bin/generate_schema.py index 0ef4f0125..9b842b98a 100755 --- a/bin/generate_schema.py +++ b/bin/generate_schema.py @@ -271,7 +271,7 @@ ) for key, value in schema["properties"].items(): - value["title"] = f'CIBW_{key.replace("-", "_").upper()}' + value["title"] = f"CIBW_{key.replace('-', '_').upper()}" non_global_options = {k: {"$ref": f"#/properties/{k}"} for k in schema["properties"]} del non_global_options["build"] diff --git a/bin/projects.py b/bin/projects.py index 09c5dc7f4..0278af5b3 100755 --- a/bin/projects.py +++ b/bin/projects.py @@ -95,8 +95,8 @@ def __lt__(self, other: Project) -> bool: def header(cls) -> str: return textwrap.dedent( f"""\ - | {'Name':{cls.NAME}} | CI | OS | Notes | - |{'':-^{cls.NAME+2 }}|----|----|:------|""" + | {"Name":{cls.NAME}} | CI | OS | Notes | + |{"":-^{cls.NAME + 2}}|----|----|:------|""" ) @property @@ -219,7 +219,7 @@ def insert_projects_table( generated_note = f"" new_text = ( - f"{text[:start + len(start_str)]}\n{generated_note}\n\n{projects_table}\n{text[end:]}" + f"{text[: start + len(start_str)]}\n{generated_note}\n\n{projects_table}\n{text[end:]}" ) file.write_text(new_text) diff --git a/cibuildwheel/linux.py b/cibuildwheel/linux.py index 8c17a0908..83b6f8738 100644 --- a/cibuildwheel/linux.py +++ b/cibuildwheel/linux.py @@ -188,7 +188,7 @@ def build_in_container( log.step("Running before_all...") env = container.get_environment() - env["PATH"] = f'/opt/python/cp39-cp39/bin:{env["PATH"]}' + env["PATH"] = f"/opt/python/cp39-cp39/bin:{env['PATH']}" env["PIP_DISABLE_PIP_VERSION_CHECK"] = "1" env["PIP_ROOT_USER_ACTION"] = "ignore" env = before_all_options.environment.as_dictionary( @@ -230,7 +230,7 @@ def build_in_container( # put this config's python top of the list python_bin = config.path / "bin" - env["PATH"] = f'{python_bin}:{env["PATH"]}' + env["PATH"] = f"{python_bin}:{env['PATH']}" env = build_options.environment.as_dictionary(env, executor=container.environment_executor) diff --git a/cibuildwheel/macos.py b/cibuildwheel/macos.py index fbef9bc43..2fae4df33 100644 --- a/cibuildwheel/macos.py +++ b/cibuildwheel/macos.py @@ -129,7 +129,7 @@ def get_python_configurations( log.quiet( unwrap( f""" - Note: {ids} {'was' if len(removed_elements) == 1 else 'were'} + Note: {ids} {"was" if len(removed_elements) == 1 else "were"} selected, but can't be built on x86_64 so will be skipped automatically. """ ) @@ -154,7 +154,7 @@ def install_cpython(_tmp: Path, version: str, url: str, free_threading: bool) -> Error: CPython {version} is not installed. cibuildwheel will not perform system-wide installs when running outside of CI. To build locally, install CPython {version} on this machine, or, disable this - version of Python using CIBW_SKIP=cp{version.replace('.', '')}-macosx_* + version of Python using CIBW_SKIP=cp{version.replace(".", "")}-macosx_* For portable builds, cibuildwheel needs the official builds from python.org. Download link: {url} """ @@ -229,9 +229,9 @@ def setup_python( else: msg = "Unknown Python implementation" raise ValueError(msg) - assert ( - base_python.exists() - ), f"{base_python.name} not found, has {list(base_python.parent.iterdir())}" + assert base_python.exists(), ( + f"{base_python.name} not found, has {list(base_python.parent.iterdir())}" + ) log.step("Setting up build environment...") venv_path = tmp / "venv" diff --git a/test/test_0_basic.py b/test/test_0_basic.py index 6663b2da9..e39109083 100644 --- a/test/test_0_basic.py +++ b/test/test_0_basic.py @@ -64,9 +64,9 @@ def test_build_identifiers(tmp_path): build_identifiers = utils.cibuildwheel_get_build_identifiers( project_dir, prerelease_pythons=True ) - assert len(expected_wheels) == len( - build_identifiers - ), f"{expected_wheels} vs {build_identifiers}" + assert len(expected_wheels) == len(build_identifiers), ( + f"{expected_wheels} vs {build_identifiers}" + ) @pytest.mark.parametrize( diff --git a/test/test_from_sdist.py b/test/test_from_sdist.py index 23f8b6b90..edb446ae9 100644 --- a/test/test_from_sdist.py +++ b/test/test_from_sdist.py @@ -77,7 +77,7 @@ def test_simple(tmp_path): assert os.path.exists('{package}/setup.py') """, ) - setup_py_assertion_cmd = f'python -c "{setup_py_assertion_snippet !s}"' + setup_py_assertion_cmd = f'python -c "{setup_py_assertion_snippet!s}"' # build the wheels from sdist actual_wheels = cibuildwheel_from_sdist_run( diff --git a/test/utils.py b/test/utils.py index aa23638d6..2d9334e8b 100644 --- a/test/utils.py +++ b/test/utils.py @@ -295,12 +295,12 @@ def expected_wheels( if machine_arch == "arm64": arm64_macosx = _floor_macosx(min_macosx, "11.0") - platform_tags = [f'macosx_{arm64_macosx.replace(".", "_")}_arm64'] + platform_tags = [f"macosx_{arm64_macosx.replace('.', '_')}_arm64"] else: - platform_tags = [f'macosx_{min_macosx.replace(".", "_")}_x86_64'] + platform_tags = [f"macosx_{min_macosx.replace('.', '_')}_x86_64"] if include_universal2: - platform_tags.append(f'macosx_{min_macosx.replace(".", "_")}_universal2') + platform_tags.append(f"macosx_{min_macosx.replace('.', '_')}_universal2") else: msg = f"Unsupported platform {platform!r}" raise Exception(msg)