diff --git a/faststream/broker/fastapi/route.py b/faststream/broker/fastapi/route.py index 1ee27caefc..e7ae9febbb 100644 --- a/faststream/broker/fastapi/route.py +++ b/faststream/broker/fastapi/route.py @@ -72,7 +72,7 @@ def __init__( if isinstance(endpoint, HandlerCallWrapper): orig_call = endpoint._original_call while hasattr(orig_call, "__consumer__"): - orig_call = orig_call.__wrapped__ # type: ignore[attr-defined] + orig_call = orig_call.__wrapped__ # type: ignore[union-attr] else: orig_call = endpoint @@ -106,12 +106,13 @@ def __init__( ) ) + handler: HandlerCallWrapper[Any, Any, Any] if isinstance(endpoint, HandlerCallWrapper): endpoint._original_call = call handler = endpoint else: - handler = call + handler = call # type: ignore[assignment] self.handler = broker.subscriber( # type: ignore[assignment,call-arg] *extra, diff --git a/faststream/utils/classes.py b/faststream/utils/classes.py index 316687eb0a..1bf053cbce 100644 --- a/faststream/utils/classes.py +++ b/faststream/utils/classes.py @@ -1,4 +1,4 @@ -from typing import Any, ClassVar, Optional, cast +from typing import Any, ClassVar, Optional from typing_extensions import Self @@ -28,7 +28,7 @@ def __new__(cls, *args: Any, **kwargs: Any) -> Self: """ if cls._instance is None: cls._instance = super().__new__(cls) - return cast(Self, cls._instance) + return cls._instance @classmethod def _drop(cls) -> None: diff --git a/pyproject.toml b/pyproject.toml index cb15482ce1..21fb85de92 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -97,7 +97,7 @@ devdocs = [ types = [ "faststream[optionals]", - "mypy==1.10.1", + "mypy==1.11.0", # mypy extensions "types-Deprecated", "types-PyYAML", @@ -111,16 +111,16 @@ types = [ lint = [ "faststream[types]", - "ruff==0.5.2", + "ruff==0.5.4", "bandit==1.7.9", - "semgrep==1.79.0", + "semgrep==1.80.0", "codespell==2.3.0", ] test-core = [ "coverage[toml]==7.6.0", - "pytest==8.2.2", - "pytest-asyncio==0.23.7", + "pytest==8.3.1", + "pytest-asyncio==0.23.8", "dirty-equals==0.7.1.post0", "typing-extensions>=4.8.0,<4.12.1; python_version < '3.9'", # to fix dirty-equals ] @@ -341,4 +341,3 @@ omit = [ [tool.codespell] skip = "./venv,./docs/site/*" ignore-words = ".codespell-whitelist.txt" -