diff --git a/.gitignore b/.gitignore index 068012f..8cf31db 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,6 @@ __pycache__/* .idea .DS_Store .env -.mypy_cache .pytest_cache .ruff_cache .coverage diff --git a/Justfile b/Justfile index fabf8c0..0853917 100644 --- a/Justfile +++ b/Justfile @@ -8,13 +8,13 @@ lint: uv run eof-fixer . uv run ruff format uv run ruff check --fix - uv run mypy . + uv run ty check lint-ci: uv run eof-fixer . --check uv run ruff format --check uv run ruff check --no-fix - uv run mypy . + uv run ty check test *args: uv run --no-sync pytest {{ args }} diff --git a/README.md b/README.md index 05b0c73..9d064fa 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ "Modern-DI-Faststream" == [![Test Coverage](https://codecov.io/gh/modern-python/modern-di-faststream/branch/main/graph/badge.svg)](https://codecov.io/gh/modern-python/modern-di-faststream) -[![MyPy Strict](https://img.shields.io/badge/mypy-strict-blue)](https://mypy.readthedocs.io/en/stable/getting_started.html#strict-mode-and-configuration) [![Supported versions](https://img.shields.io/pypi/pyversions/modern-di-faststream.svg)](https://pypi.python.org/pypi/modern-di-faststream) [![downloads](https://img.shields.io/pypi/dm/modern-di-faststream.svg)](https://pypistats.org/packages/modern-di-faststream) [![GitHub stars](https://img.shields.io/github/stars/modern-python/modern-di-faststream)](https://github.com/modern-python/modern-di-faststream/stargazers) diff --git a/modern_di_faststream/main.py b/modern_di_faststream/main.py index 7c9a62d..a3e37b4 100644 --- a/modern_di_faststream/main.py +++ b/modern_di_faststream/main.py @@ -34,7 +34,7 @@ def __call__(self, *args: P.args, **kwargs: P.kwargs) -> "_DiMiddleware[P]": class _DiMiddleware(faststream.BaseMiddleware, typing.Generic[P]): def __init__(self, di_container: Container, *args: P.args, **kwargs: P.kwargs) -> None: self.di_container = di_container - super().__init__(*args, **kwargs) # type: ignore[arg-type] + super().__init__(*args, **kwargs) async def consume_scope( self, @@ -81,7 +81,7 @@ def setup_di( container.providers_registry.add_providers(faststream_message_provider) app.context.set_global("di_container", container) app.after_shutdown(container.close_async) - app.broker.add_middleware(_DIMiddlewareFactory(container)) + app.broker.add_middleware(_DIMiddlewareFactory(container)) # type: ignore[invalid-argument-type] return container diff --git a/pyproject.toml b/pyproject.toml index b7629f1..2538657 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,7 +32,7 @@ dev = [ "asgi-lifespan", ] lint = [ - "mypy", + "ty", "ruff", "eof-fixer", "typing-extensions", @@ -45,10 +45,6 @@ build-backend = "hatchling.build" [tool.hatch.build] include = ["modern_di_faststream"] -[tool.mypy] -python_version = "3.10" -strict = true - [tool.ruff] fix = false unsafe-fixes = true