diff --git a/pact-python-cli/pyproject.toml b/pact-python-cli/pyproject.toml index 5f881746f..2c8ccf4ae 100644 --- a/pact-python-cli/pyproject.toml +++ b/pact-python-cli/pyproject.toml @@ -53,7 +53,7 @@ requires-python = ">=3.10" # developper consistency. All other dependencies are as above. dev = ["ruff==0.14.6", { include-group = "test" }, { include-group = "types" }] test = ["pytest-cov~=7.0", "pytest~=9.0"] -types = ["mypy==1.18.2"] +types = ["mypy==1.19.0"] ################################################################################ ## Build System diff --git a/pact-python-ffi/pyproject.toml b/pact-python-ffi/pyproject.toml index 006adea0d..f7f006019 100644 --- a/pact-python-ffi/pyproject.toml +++ b/pact-python-ffi/pyproject.toml @@ -43,7 +43,7 @@ dependencies = ["cffi~=2.0"] [dependency-groups] dev = ["ruff==0.14.6", { include-group = "test" }, { include-group = "types" }] test = ["pytest-cov~=7.0", "pytest~=9.0"] -types = ["mypy==1.18.2", "typing-extensions~=4.0"] +types = ["mypy==1.19.0", "typing-extensions~=4.0"] ################################################################################ ## Build System diff --git a/pyproject.toml b/pyproject.toml index f6d153a39..dcf9a9b60 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -121,7 +121,7 @@ test = [ "testcontainers~=4.0", ] types = [ - "mypy==1.18.2", + "mypy==1.19.0", "types-grpcio~=1.0", "types-protobuf~=6.0", "types-requests~=2.0", diff --git a/src/pact/generate/__init__.py b/src/pact/generate/__init__.py index 26741ff7f..5067c3a9c 100644 --- a/src/pact/generate/__init__.py +++ b/src/pact/generate/__init__.py @@ -146,7 +146,7 @@ def __import__( # noqa: N807 name: builtins.str, globals: Mapping[builtins.str, object] | None = None, locals: Mapping[builtins.str, object] | None = None, - fromlist: Sequence[builtins.str] = (), + fromlist: Sequence[builtins.str] | None = None, level: builtins.int = 0, ) -> ModuleType: """ @@ -157,6 +157,7 @@ def __import__( # noqa: N807 done to avoid shadowing built-in types and functions. """ __tracebackhide__ = True + fromlist = fromlist or () if name == "pact.generate" and len(set(fromlist) - {"AbstractGenerator"}) > 0: warnings.warn( "Avoid `from pact.generate import `. " diff --git a/src/pact/match/__init__.py b/src/pact/match/__init__.py index c6af3ceda..0d0503b7c 100644 --- a/src/pact/match/__init__.py +++ b/src/pact/match/__init__.py @@ -317,7 +317,7 @@ def __import__( # noqa: N807 name: builtins.str, globals: Mapping[builtins.str, object] | None = None, locals: Mapping[builtins.str, object] | None = None, - fromlist: Sequence[builtins.str] = (), + fromlist: Sequence[builtins.str] | None = None, level: builtins.int = 0, ) -> ModuleType: """ @@ -328,6 +328,7 @@ def __import__( # noqa: N807 avoid shadowing built-in types and functions. """ __tracebackhide__ = True + fromlist = fromlist or () if name == "pact.match" and len(set(fromlist) - {"AbstractMatcher"}) > 0: warnings.warn( "Avoid `from pact.match import `. "