From 2cf7f2b4ef3db83f99c65068b2e75f9b120acf0e Mon Sep 17 00:00:00 2001 From: JP-Ellis Date: Mon, 16 Feb 2026 01:12:31 +0000 Subject: [PATCH] chore(deps): update ruff to v0.15.1 --- .pre-commit-config.yaml | 2 +- docs/scripts/other.py | 2 +- pact-python-cli/hatch_build.py | 2 +- pact-python-cli/pyproject.toml | 2 +- pact-python-ffi/hatch_build.py | 2 +- pact-python-ffi/pyproject.toml | 2 +- pact-python-ffi/src/pact_ffi/__init__.py | 4 ++-- pyproject.toml | 2 +- src/pact/_util.py | 2 +- tests/compatibility_suite/util/consumer.py | 4 ++-- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a36ed265e..d4194c4eb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -39,7 +39,7 @@ repos: - id: biome-check - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.14.14 + rev: v0.15.1 hooks: - id: ruff-check exclude: | diff --git a/docs/scripts/other.py b/docs/scripts/other.py index 34bfde76e..31d60dbf2 100644 --- a/docs/scripts/other.py +++ b/docs/scripts/other.py @@ -72,7 +72,7 @@ def is_binary(buffer: bytes) -> bool: for source_path in ALL_FILES: if not source_path.is_file(): continue - if source_path.parts[0] in ["docs"]: + if source_path.parts[0] == "docs": continue dest_path = Path(DOCS_DEST, source_path) diff --git a/pact-python-cli/hatch_build.py b/pact-python-cli/hatch_build.py index da0e0f3c9..650b356c0 100644 --- a/pact-python-cli/hatch_build.py +++ b/pact-python-cli/hatch_build.py @@ -238,7 +238,7 @@ def _download(self, url: str) -> Path: Returns: The path to the downloaded artefact. """ - filename = url.split("/")[-1] + filename = url.rsplit("/", maxsplit=1)[-1] artefact = PKG_DIR / "data" / filename artefact.parent.mkdir(parents=True, exist_ok=True) diff --git a/pact-python-cli/pyproject.toml b/pact-python-cli/pyproject.toml index cb7d483cd..528ad5e52 100644 --- a/pact-python-cli/pyproject.toml +++ b/pact-python-cli/pyproject.toml @@ -54,7 +54,7 @@ requires-python = ">=3.10" [dependency-groups] # Linting and formatting tools use a more narrow specification to ensure # developper consistency. All other dependencies are as above. -dev = ["ruff==0.14.14", { include-group = "test" }, { include-group = "types" }] +dev = ["ruff==0.15.1", { include-group = "test" }, { include-group = "types" }] test = ["pytest-cov~=7.0", "pytest~=9.0"] types = ["mypy==1.19.1"] diff --git a/pact-python-ffi/hatch_build.py b/pact-python-ffi/hatch_build.py index f730b2192..80d0e7bc6 100644 --- a/pact-python-ffi/hatch_build.py +++ b/pact-python-ffi/hatch_build.py @@ -383,7 +383,7 @@ def _download(self, url: str) -> Path: Returns: The path to the downloaded artefact. """ - filename = url.split("/")[-1] + filename = url.rsplit("/", maxsplit=1)[-1] artefact = PKG_DIR / "data" / filename artefact.parent.mkdir(parents=True, exist_ok=True) diff --git a/pact-python-ffi/pyproject.toml b/pact-python-ffi/pyproject.toml index eed206b83..983b42777 100644 --- a/pact-python-ffi/pyproject.toml +++ b/pact-python-ffi/pyproject.toml @@ -41,7 +41,7 @@ dependencies = ["cffi~=2.0"] "Repository" = "https://github.com/pact-foundation/pact-python" [dependency-groups] -dev = ["ruff==0.14.14", { include-group = "test" }, { include-group = "types" }] +dev = ["ruff==0.15.1", { include-group = "test" }, { include-group = "types" }] test = ["pytest-cov~=7.0", "pytest~=9.0"] types = ["mypy==1.19.1", "typing-extensions~=4.0"] diff --git a/pact-python-ffi/src/pact_ffi/__init__.py b/pact-python-ffi/src/pact_ffi/__init__.py index ca0141605..04ae931b5 100644 --- a/pact-python-ffi/src/pact_ffi/__init__.py +++ b/pact-python-ffi/src/pact_ffi/__init__.py @@ -6452,7 +6452,7 @@ def with_binary_body( interaction._ref, part.value, content_type.encode("utf-8") if content_type else ffi.NULL, - body if body else ffi.NULL, + body or ffi.NULL, len(body) if body else 0, ) if not success: @@ -6511,7 +6511,7 @@ def with_binary_file( interaction._ref, part.value, content_type.encode("utf-8") if content_type else ffi.NULL, - body if body else ffi.NULL, + body or ffi.NULL, len(body) if body else 0, ) if not success: diff --git a/pyproject.toml b/pyproject.toml index 7d7a6b884..9edd53f27 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -73,7 +73,7 @@ dependencies = [ # Linting and formatting tools use a more narrow specification to ensure # developper consistency. All other dependencies are as above. dev = [ - "ruff==0.14.14", + "ruff==0.15.1", { include-group = "docs" }, { include-group = "example" }, { include-group = "test" }, diff --git a/src/pact/_util.py b/src/pact/_util.py index 6fe8cc2e4..ba7dcff73 100644 --- a/src/pact/_util.py +++ b/src/pact/_util.py @@ -151,7 +151,7 @@ def format_code_to_java_format(code: str) -> str: raise ValueError(msg) # The following codes simply do not have a direct equivalent in Java. - if code in ["w"]: + if code == "w": msg = f"Python format code `%{code}` is not supported in Java" raise ValueError(msg) diff --git a/tests/compatibility_suite/util/consumer.py b/tests/compatibility_suite/util/consumer.py index 237a9b804..673ebbca9 100644 --- a/tests/compatibility_suite/util/consumer.py +++ b/tests/compatibility_suite/util/consumer.py @@ -239,7 +239,7 @@ def _( if definition.query else None ), - headers=definition.headers if definition.headers else None, # type: ignore[arg-type] + headers=definition.headers or None, # type: ignore[arg-type] data=definition.body.bytes if definition.body else None, timeout=5, ) @@ -293,7 +293,7 @@ def _( if definition.query else None ), - headers=definition.headers if definition.headers else None, # type: ignore[arg-type] + headers=definition.headers or None, # type: ignore[arg-type] data=definition.body.bytes if definition.body else None, timeout=5, )