Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deps): update ruff to v0.10.0 #1024

Merged
merged 2 commits into from
Mar 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ repos:
- id: taplo-lint

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.10
rev: v0.10.0
hooks:
- id: ruff
# Exclude python files in pact/** and tests/**, except for the
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ dependencies = [
[project.optional-dependencies]
# Linting and formatting tools use a more narrow specification to ensure
# developper consistency. All other dependencies are as above.
devel = ["pact-python[devel-types,devel-docs,devel-test]", "ruff==0.9.10"]
devel = ["pact-python[devel-types,devel-docs,devel-test]", "ruff==0.10.0"]
devel-docs = [
"mkdocs-literate-nav~=0.6",
"mkdocs-material[imaging]~=9.4",
Expand Down
2 changes: 1 addition & 1 deletion src/pact/v3/ffi.py
Original file line number Diff line number Diff line change
Expand Up @@ -1755,7 +1755,7 @@ def __init__(self, cdata: cffi.FFI.CData) -> None:
if ffi.typeof(cdata).cname != "struct StringResult":
msg = f"cdata must be a struct StringResult, got {ffi.typeof(cdata).cname}"
raise TypeError(msg)
self._cdata = typing.cast(StringResult._StringResultCData, cdata)
self._cdata = typing.cast("StringResult._StringResultCData", cdata)

def __str__(self) -> str:
"""
Expand Down
1 change: 0 additions & 1 deletion src/pact/v3/types.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# noqa: A005
"""
Typing definitions for the matchers.

Expand Down
29 changes: 15 additions & 14 deletions src/pact/v3/verifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,20 +87,21 @@

import pact.v3.ffi
from pact.v3._server import MessageProducer, StateCallback
from pact.v3.types import (
Message,
MessageProducerFull,
MessageProducerNoName,
StateHandlerFull,
StateHandlerNoAction,
StateHandlerNoActionNoState,
StateHandlerNoState,
StateHandlerUrl,
)

if TYPE_CHECKING:
from collections.abc import Iterable

from pact.v3.types import (
Message,
MessageProducerFull,
MessageProducerNoName,
StateHandlerFull,
StateHandlerNoAction,
StateHandlerNoActionNoState,
StateHandlerNoState,
StateHandlerUrl,
)

logger = logging.getLogger(__name__)


Expand Down Expand Up @@ -692,7 +693,7 @@
msg = "All functions must take two arguments: action and parameters"
raise TypeError(msg)

handler_map = typing.cast(dict[str, StateHandlerNoState], handler)
handler_map = typing.cast("dict[str, StateHandlerNoState]", handler)

Check warning on line 696 in src/pact/v3/verifier.py

View check run for this annotation

Codecov / codecov/patch

src/pact/v3/verifier.py#L696

Added line #L696 was not covered by tests

def _handler(
state: str,
Expand All @@ -707,7 +708,7 @@
raise TypeError(msg)

handler_map_no_action = typing.cast(
dict[str, StateHandlerNoActionNoState],
"dict[str, StateHandlerNoActionNoState]",
handler,
)

Expand Down Expand Up @@ -771,7 +772,7 @@
)
raise TypeError(msg)

handler_fn_full = typing.cast(StateHandlerFull, handler)
handler_fn_full = typing.cast("StateHandlerFull", handler)

def _handler(
state: str,
Expand All @@ -785,7 +786,7 @@
msg = "The function must take two arguments: state and parameters"
raise TypeError(msg)

handler_fn_no_action = typing.cast(StateHandlerNoAction, handler)
handler_fn_no_action = typing.cast("StateHandlerNoAction", handler)

Check warning on line 789 in src/pact/v3/verifier.py

View check run for this annotation

Codecov / codecov/patch

src/pact/v3/verifier.py#L789

Added line #L789 was not covered by tests

def _handler(
state: str,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def parse_fixture(self, fixture: Path) -> None:
if content_type is None:
msg = "Invalid XML fixture document: no contentType"
raise ValueError(msg)
self.string = typing.cast(str, contents.text)
self.string = typing.cast("str", contents.text)

if eol := contents.attrib.get("eol", None):
if eol == "CRLF":
Expand Down
Loading