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

* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.8.6 → v0.9.1](https://github.com/astral-sh/ruff-pre-commit/compare/v0.8.6...v0.9.1)
- [github.com/python-jsonschema/check-jsonschema: 0.30.0 → 0.31.0](https://github.com/python-jsonschema/check-jsonschema/compare/0.30.0...0.31.0)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
pre-commit-ci[bot]
2025-01-20 11:17:01 +00:00
committed by GitHub
parent a96545b729
commit c65b088000
8 changed files with 20 additions and 20 deletions
+2 -2
View File
@@ -14,7 +14,7 @@ repos:
- id: trailing-whitespace - id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit - repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.6 rev: v0.9.1
hooks: hooks:
- id: ruff - id: ruff
args: ["--fix", "--show-fixes"] args: ["--fix", "--show-fixes"]
@@ -81,7 +81,7 @@ repos:
- repo: https://github.com/python-jsonschema/check-jsonschema - repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.30.0 rev: 0.31.0
hooks: hooks:
- id: check-dependabot - id: check-dependabot
- id: check-github-actions - id: check-github-actions
+1 -1
View File
@@ -271,7 +271,7 @@ items:
) )
for key, value in schema["properties"].items(): 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"]} non_global_options = {k: {"$ref": f"#/properties/{k}"} for k in schema["properties"]}
del non_global_options["build"] del non_global_options["build"]
+3 -3
View File
@@ -95,8 +95,8 @@ class Project:
def header(cls) -> str: def header(cls) -> str:
return textwrap.dedent( return textwrap.dedent(
f"""\ f"""\
| {'Name':{cls.NAME}} | CI | OS | Notes | | {"Name":{cls.NAME}} | CI | OS | Notes |
|{'':-^{cls.NAME+2 }}|----|----|:------|""" |{"":-^{cls.NAME + 2}}|----|----|:------|"""
) )
@property @property
@@ -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} -->" generated_note = f"<!-- this section is generated by bin/projects.py. Don't edit it directly, instead, edit {input_filename} -->"
new_text = ( 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) file.write_text(new_text)
+2 -2
View File
@@ -188,7 +188,7 @@ def build_in_container(
log.step("Running before_all...") log.step("Running before_all...")
env = container.get_environment() 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_DISABLE_PIP_VERSION_CHECK"] = "1"
env["PIP_ROOT_USER_ACTION"] = "ignore" env["PIP_ROOT_USER_ACTION"] = "ignore"
env = before_all_options.environment.as_dictionary( env = before_all_options.environment.as_dictionary(
@@ -230,7 +230,7 @@ def build_in_container(
# put this config's python top of the list # put this config's python top of the list
python_bin = config.path / "bin" 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) env = build_options.environment.as_dictionary(env, executor=container.environment_executor)
+5 -5
View File
@@ -129,7 +129,7 @@ def get_python_configurations(
log.quiet( log.quiet(
unwrap( unwrap(
f""" 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. 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. Error: CPython {version} is not installed.
cibuildwheel will not perform system-wide installs when running outside of CI. cibuildwheel will not perform system-wide installs when running outside of CI.
To build locally, install CPython {version} on this machine, or, disable this 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. For portable builds, cibuildwheel needs the official builds from python.org.
Download link: {url} Download link: {url}
""" """
@@ -229,9 +229,9 @@ def setup_python(
else: else:
msg = "Unknown Python implementation" msg = "Unknown Python implementation"
raise ValueError(msg) raise ValueError(msg)
assert ( assert base_python.exists(), (
base_python.exists() f"{base_python.name} not found, has {list(base_python.parent.iterdir())}"
), f"{base_python.name} not found, has {list(base_python.parent.iterdir())}" )
log.step("Setting up build environment...") log.step("Setting up build environment...")
venv_path = tmp / "venv" venv_path = tmp / "venv"
+3 -3
View File
@@ -64,9 +64,9 @@ def test_build_identifiers(tmp_path):
build_identifiers = utils.cibuildwheel_get_build_identifiers( build_identifiers = utils.cibuildwheel_get_build_identifiers(
project_dir, prerelease_pythons=True project_dir, prerelease_pythons=True
) )
assert len(expected_wheels) == len( assert len(expected_wheels) == len(build_identifiers), (
build_identifiers f"{expected_wheels} vs {build_identifiers}"
), f"{expected_wheels} vs {build_identifiers}" )
@pytest.mark.parametrize( @pytest.mark.parametrize(
+1 -1
View File
@@ -77,7 +77,7 @@ def test_simple(tmp_path):
assert os.path.exists('{package}/setup.py') 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 # build the wheels from sdist
actual_wheels = cibuildwheel_from_sdist_run( actual_wheels = cibuildwheel_from_sdist_run(
+3 -3
View File
@@ -295,12 +295,12 @@ def expected_wheels(
if machine_arch == "arm64": if machine_arch == "arm64":
arm64_macosx = _floor_macosx(min_macosx, "11.0") 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: else:
platform_tags = [f'macosx_{min_macosx.replace(".", "_")}_x86_64'] platform_tags = [f"macosx_{min_macosx.replace('.', '_')}_x86_64"]
if include_universal2: if include_universal2:
platform_tags.append(f'macosx_{min_macosx.replace(".", "_")}_universal2') platform_tags.append(f"macosx_{min_macosx.replace('.', '_')}_universal2")
else: else:
msg = f"Unsupported platform {platform!r}" msg = f"Unsupported platform {platform!r}"
raise Exception(msg) raise Exception(msg)