From 57e87578990d95de699299a94ca4c7b318a992d4 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 13 Feb 2026 11:24:27 -0500 Subject: [PATCH] [pre-commit.ci] pre-commit autoupdate (#2739) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/astral-sh/ruff-pre-commit: v0.14.14 → v0.15.0](https://github.com/astral-sh/ruff-pre-commit/compare/v0.14.14...v0.15.0) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Refactor test_command checks to use set syntax * Apply suggestion from @henryiii * [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> Co-authored-by: Henry Schreiner --- .pre-commit-config.yaml | 2 +- bin/update_pythons.py | 2 +- cibuildwheel/platforms/android.py | 6 +++--- cibuildwheel/platforms/macos.py | 2 +- cibuildwheel/selector.py | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6e477219..c4cb1dc9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,7 +14,7 @@ repos: - id: trailing-whitespace - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.14.14 + rev: v0.15.0 hooks: - id: ruff-check args: ["--fix", "--show-fixes"] diff --git a/bin/update_pythons.py b/bin/update_pythons.py index 277f2397..c55ba6f5 100755 --- a/bin/update_pythons.py +++ b/bin/update_pythons.py @@ -126,7 +126,7 @@ class GraalPyVersions: msg = f"{identifier} not supported yet on GraalPy" raise RuntimeError(msg) - gpspec_str = identifier.split("-")[0].split("_")[1] + gpspec_str = identifier.split("-", maxsplit=1)[0].split("_")[1] if "." not in gpspec_str and len(gpspec_str) == 3: gpspec_str = gpspec_str[:2] + "." + gpspec_str[-1] gpspec = Specifier(f"=={gpspec_str}.*") diff --git a/cibuildwheel/platforms/android.py b/cibuildwheel/platforms/android.py index e706ccaa..3d23deb1 100644 --- a/cibuildwheel/platforms/android.py +++ b/cibuildwheel/platforms/android.py @@ -687,7 +687,7 @@ def test_wheel(state: BuildState, wheel: Path, *, build_frontend: str) -> None: ) # Android doesn't support placeholders in the test command. - if any(("{" + placeholder + "}") in test_command for placeholder in ["project", "package"]): + if any(("{" + placeholder + "}") in test_command for placeholder in ("project", "package")): msg = ( f"Test command {test_command!r} with a " "'{project}' or '{package}' placeholder is not supported on Android, " @@ -697,12 +697,12 @@ def test_wheel(state: BuildState, wheel: Path, *, build_frontend: str) -> None: # Parse test-command. test_args = shlex.split(test_command) - if test_args[0] in ["python", "python3"] and any(arg in test_args for arg in ["-c", "-m"]): + if test_args[0] in {"python", "python3"} and any(arg in test_args for arg in ("-c", "-m")): # Forward the args to the CPython testbed script. We require '-c' or '-m' # to be in the command, because without those flags, the testbed script # will prepend '-m test', which will run Python's own test suite. del test_args[0] - elif test_args[0] in ["pytest"]: + elif test_args[0] == "pytest": # We transform some commands into the `python -m` form, but this is deprecated. msg = ( f"Test command {test_command!r} is not supported on Android. " diff --git a/cibuildwheel/platforms/macos.py b/cibuildwheel/platforms/macos.py index 0e7d0275..b782dd37 100644 --- a/cibuildwheel/platforms/macos.py +++ b/cibuildwheel/platforms/macos.py @@ -151,7 +151,7 @@ def install_cpython(_tmp: Path, version: str, url: str, free_threading: bool) -> """ ) raise errors.FatalError(msg) - python_filename = url.split("/")[-1] + python_filename = url.rsplit("/", maxsplit=1)[-1] pkg_path = CIBW_CACHE_PATH / "cpython-installer" / python_filename if not pkg_path.exists(): download(url, pkg_path) diff --git a/cibuildwheel/selector.py b/cibuildwheel/selector.py index 53d08b9c..29ad204b 100644 --- a/cibuildwheel/selector.py +++ b/cibuildwheel/selector.py @@ -75,7 +75,7 @@ class BuildSelector: def __call__(self, build_id: str) -> bool: # Filter build selectors by python_requires if set if self.requires_python is not None: - py_ver_str = build_id.split("-")[0].split("_")[0] + py_ver_str = build_id.split("-", maxsplit=1)[0].split("_")[0] py_ver_str = py_ver_str.removesuffix("t") major = int(py_ver_str[2]) minor = int(py_ver_str[3:])