diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0a2731823..478362f79 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -44,7 +44,7 @@ repos: - '@biomejs/biome@1.9.4' - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.7.4 + rev: v0.8.0 hooks: - id: ruff # Exclude python files in pact/** and tests/**, except for the diff --git a/pyproject.toml b/pyproject.toml index f109b142f..97cd26c40 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -87,7 +87,7 @@ devel-test = [ "pytest-cov ~=6.0", "testcontainers ~=4.0", ] -devel = ["pact-python[devel-types,devel-docs,devel-test]", "ruff==0.7.4"] +devel = ["pact-python[devel-types,devel-docs,devel-test]", "ruff==0.8.0"] ################################################################################ ## Hatch Build Configuration @@ -276,8 +276,6 @@ ignore = [ "D200", # Require single line docstrings to be on one line. "D203", # Require blank line before class docstring "D212", # Multi-line docstring summary must start at the first line - "ANN101", # `self` must be typed - "ANN102", # `cls` must be typed "FIX002", # Forbid TODO in comments "TD002", # Assign someone to 'TODO' comments diff --git a/src/pact/v3/generate/__init__.py b/src/pact/v3/generate/__init__.py index ba94ca5e5..f961ac261 100644 --- a/src/pact/v3/generate/__init__.py +++ b/src/pact/v3/generate/__init__.py @@ -33,25 +33,25 @@ # # __all__ = [ - "int", - "integer", - "float", + "Generator", + "bool", + "boolean", + "date", + "datetime", "decimal", + "float", "hex", "hexadecimal", + "int", + "integer", + "mock_server_url", + "provider_state", + "regex", "str", "string", - "regex", - "uuid", - "date", "time", - "datetime", "timestamp", - "bool", - "boolean", - "provider_state", - "mock_server_url", - "Generator", + "uuid", ] # We prevent users from importing from this module to avoid shadowing built-ins. diff --git a/src/pact/v3/interaction/__init__.py b/src/pact/v3/interaction/__init__.py index 661fed172..4116277d2 100644 --- a/src/pact/v3/interaction/__init__.py +++ b/src/pact/v3/interaction/__init__.py @@ -76,8 +76,8 @@ from pact.v3.interaction._sync_message_interaction import SyncMessageInteraction __all__ = [ - "Interaction", - "HttpInteraction", "AsyncMessageInteraction", + "HttpInteraction", + "Interaction", "SyncMessageInteraction", ] diff --git a/src/pact/v3/match/__init__.py b/src/pact/v3/match/__init__.py index 247dbff62..2e1cca35b 100644 --- a/src/pact/v3/match/__init__.py +++ b/src/pact/v3/match/__init__.py @@ -82,31 +82,31 @@ # # __all__ = [ + "Matcher", + "array_containing", + "bool", + "boolean", + "date", + "datetime", + "decimal", + "each_key_matches", + "each_like", + "each_value_matches", + "float", + "includes", "int", "integer", - "float", - "decimal", + "like", + "none", + "null", "number", + "regex", "str", "string", - "regex", - "uuid", - "bool", - "boolean", - "date", "time", - "datetime", "timestamp", - "none", - "null", "type", - "like", - "each_like", - "includes", - "array_containing", - "each_key_matches", - "each_value_matches", - "Matcher", + "uuid", ] _T = TypeVar("_T") diff --git a/tests/v3/compatibility_suite/util/consumer.py b/tests/v3/compatibility_suite/util/consumer.py index f880d6f56..811a1124e 100644 --- a/tests/v3/compatibility_suite/util/consumer.py +++ b/tests/v3/compatibility_suite/util/consumer.py @@ -722,8 +722,8 @@ def _( expected = {key: value} actual = pact_file["interactions"][n - 1]["request"]["headers"] assert expected.keys() == actual.keys() - for k in expected: - assert expected[k] == actual[k] or [expected[k]] == actual[k] + for k, v in expected.items(): + assert v == actual[k] or [v] == actual[k] def the_nth_interaction_request_content_type_will_be(stacklevel: int = 1) -> None: