Skip to content

Commit a874d19

Browse files
committed
chore: update ruff and add rule to detect incorrect annotations
1 parent 8c772f4 commit a874d19

File tree

4 files changed

+26
-21
lines changed

4 files changed

+26
-21
lines changed

poetry.lock

Lines changed: 20 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ requires = ["poetry-core>=1.0.0"]
123123
build-backend = "poetry.core.masonry.api"
124124

125125
[tool.ruff]
126+
target-version="py39"
126127
# List of enabled rulsets.
127128
# See https://docs.astral.sh/ruff/rules/ for more information.
128129
lint.select = [
@@ -151,6 +152,7 @@ lint.select = [
151152
"ERA", # Checks for commented out code
152153
"PL", # PyLint checks
153154
"RUF", # Specific to Ruff checks
155+
"FA102", # Future annotations
154156
]
155157
lint.ignore = [
156158
"D105", # Missing docstring in magic method

taskiq/middlewares/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
from .prometheus_middleware import PrometheusMiddleware
44
from .simple_retry_middleware import SimpleRetryMiddleware
55
from .smart_retry_middleware import SmartRetryMiddleware
6+
from .taskiq_admin_middleware import TaskiqAdminMiddleware
67

78
__all__ = (
89
"PrometheusMiddleware",
910
"SimpleRetryMiddleware",
1011
"SmartRetryMiddleware",
12+
"TaskiqAdminMiddleware",
1113
)

taskiq/middlewares/prometheus_middleware.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def __init__(
4444
logger.debug("Initializing metrics")
4545

4646
try:
47-
from prometheus_client import Counter, Histogram
47+
from prometheus_client import Counter, Histogram # noqa: PLC0415
4848
except ImportError as exc:
4949
raise ImportError(
5050
"Cannot initialize metrics. Please install 'taskiq[metrics]'.",
@@ -85,7 +85,7 @@ def startup(self) -> None:
8585
This function starts prometheus server.
8686
It starts it only in case if it's a worker process.
8787
"""
88-
from prometheus_client import start_http_server
88+
from prometheus_client import start_http_server # noqa: PLC0415
8989

9090
if self.broker.is_worker_process:
9191
try:

0 commit comments

Comments
 (0)