Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #2127

Merged
merged 2 commits into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repos:
- id: trailing-whitespace

- repo: /~https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.6
rev: v0.9.1
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
Expand Down Expand Up @@ -81,7 +81,7 @@ repos:


- repo: /~https://github.com/python-jsonschema/check-jsonschema
rev: 0.30.0
rev: 0.31.0
hooks:
- id: check-dependabot
- id: check-github-actions
Expand Down
2 changes: 1 addition & 1 deletion bin/generate_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
6 changes: 3 additions & 3 deletions bin/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -219,7 +219,7 @@ def insert_projects_table(

generated_note = f"<!-- this section is generated by bin/projects.py. Don't edit it directly, instead, edit {input_filename} -->"
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)
Expand Down
4 changes: 2 additions & 2 deletions cibuildwheel/linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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)

Expand Down
10 changes: 5 additions & 5 deletions cibuildwheel/macos.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
)
Expand All @@ -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}
"""
Expand Down Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions test/test_0_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion test/test_from_sdist.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
6 changes: 3 additions & 3 deletions test/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading