From 0c83d5bdf0cc23d9d03f435c2cff22c9d48c9d9b Mon Sep 17 00:00:00 2001 From: robfrank Date: Fri, 1 May 2026 20:14:33 +0200 Subject: [PATCH] fix formatting --- .../scripts/verify_wheel_platform_tag.py | 15 ++++++++++--- .../python/tests/test_wheel_platform_tag.py | 21 +++++++++++++------ 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/bindings/python/scripts/verify_wheel_platform_tag.py b/bindings/python/scripts/verify_wheel_platform_tag.py index 9418f13171..420b72d83f 100644 --- a/bindings/python/scripts/verify_wheel_platform_tag.py +++ b/bindings/python/scripts/verify_wheel_platform_tag.py @@ -80,10 +80,19 @@ def parse_wheel_tag(wheel_path: Path) -> tuple[tuple[int, int], str]: def main() -> int: - parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) + parser = argparse.ArgumentParser( + description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter + ) parser.add_argument("wheel", nargs="?", type=Path, help="Path to the .whl file") - parser.add_argument("jre", nargs="?", type=Path, help="Path to the bundled JRE/JDK directory") - parser.add_argument("--jre", dest="jre_only", type=Path, help="Inspect a JRE only and print its required tag") + parser.add_argument( + "jre", nargs="?", type=Path, help="Path to the bundled JRE/JDK directory" + ) + parser.add_argument( + "--jre", + dest="jre_only", + type=Path, + help="Inspect a JRE only and print its required tag", + ) args = parser.parse_args() if args.jre_only is not None: diff --git a/bindings/python/tests/test_wheel_platform_tag.py b/bindings/python/tests/test_wheel_platform_tag.py index 189a5e8a35..6c7addbfc6 100644 --- a/bindings/python/tests/test_wheel_platform_tag.py +++ b/bindings/python/tests/test_wheel_platform_tag.py @@ -19,12 +19,15 @@ import pytest - -SCRIPT_PATH = Path(__file__).resolve().parents[1] / "scripts" / "verify_wheel_platform_tag.py" +SCRIPT_PATH = ( + Path(__file__).resolve().parents[1] / "scripts" / "verify_wheel_platform_tag.py" +) def _load_verifier(): - spec = importlib.util.spec_from_file_location("verify_wheel_platform_tag", SCRIPT_PATH) + spec = importlib.util.spec_from_file_location( + "verify_wheel_platform_tag", SCRIPT_PATH + ) module = importlib.util.module_from_spec(spec) assert spec.loader is not None spec.loader.exec_module(module) @@ -62,7 +65,9 @@ def test_parse_wheel_tag_extracts_version_and_arch(tmp_path: Path) -> None: assert arch == "x86_64" -def test_main_succeeds_when_tag_matches(tmp_path: Path, capsys: pytest.CaptureFixture[str]) -> None: +def test_main_succeeds_when_tag_matches( + tmp_path: Path, capsys: pytest.CaptureFixture[str] +) -> None: verifier = _load_verifier() jre_dir = tmp_path / "jre" jre_dir.mkdir() @@ -76,7 +81,9 @@ def test_main_succeeds_when_tag_matches(tmp_path: Path, capsys: pytest.CaptureFi assert "OK" in capsys.readouterr().out -def test_main_fails_when_tag_higher_than_jre(tmp_path: Path, capsys: pytest.CaptureFixture[str]) -> None: +def test_main_fails_when_tag_higher_than_jre( + tmp_path: Path, capsys: pytest.CaptureFixture[str] +) -> None: """Reproduces issue #4037: wheel tagged manylinux_2_35 but JRE only needs GLIBC_2.34.""" verifier = _load_verifier() jre_dir = tmp_path / "jre" @@ -93,7 +100,9 @@ def test_main_fails_when_tag_higher_than_jre(tmp_path: Path, capsys: pytest.Capt assert "manylinux_2_35" in captured.err or "manylinux_2_34" in captured.err -def test_main_fails_when_tag_lower_than_jre(tmp_path: Path, capsys: pytest.CaptureFixture[str]) -> None: +def test_main_fails_when_tag_lower_than_jre( + tmp_path: Path, capsys: pytest.CaptureFixture[str] +) -> None: """A too-low tag would let the wheel install on systems where the JRE cannot run.""" verifier = _load_verifier() jre_dir = tmp_path / "jre"