diff --git a/.dockerignore b/.dockerignore index 4caaa77..aaba8ff 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,7 +2,6 @@ .coverage .gitignore .idea -.mypy_cache .ruff_cache .vscode .git 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 2cfcf21..7493538 100644 --- a/Justfile +++ b/Justfile @@ -20,13 +20,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 publish: rm -rf dist diff --git a/README.md b/README.md index 4b74828..e7d02ed 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ # Redis Timers -[![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/redis-timers.svg)](https://pypi.python.org/pypi/redis-timers) [![downloads](https://img.shields.io/pypi/dm/redis-timers.svg)](https://pypistats.org/packages/redis-timers) [![GitHub stars](https://img.shields.io/github/stars/modern-python/redis-timers)](https://github.com/modern-python/redis-timers/stargazers) diff --git a/pyproject.toml b/pyproject.toml index f70608f..578ae84 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,7 +22,7 @@ dev = [ lint = [ # linters "ruff", - "mypy", + "ty", "eof-fixer", # stubs "types-redis", @@ -36,10 +36,6 @@ build-backend = "uv_build" module-name = "redis_timers" module-root = "" -[tool.mypy] -python_version = "3.13" -strict = true - [tool.ruff] fix = true unsafe-fixes = true diff --git a/redis_timers/timers.py b/redis_timers/timers.py index 2533bfa..36a8656 100644 --- a/redis_timers/timers.py +++ b/redis_timers/timers.py @@ -32,7 +32,7 @@ class Timers: def __init__( self, *, - redis_client: Redis, # type: ignore[type-arg] + redis_client: Redis, context: dict[str, typing.Any], routers: list[Router] | None = None, ) -> None: @@ -64,7 +64,7 @@ async def fetch_ready_timers(self, timestamp: datetime.datetime) -> list[str]: ) async def _handle_one_timer(self, timer_key: str) -> None: - topic = timer_key.split(settings.TIMERS_SEPARATOR)[0] + topic = timer_key.split(settings.TIMERS_SEPARATOR, maxsplit=1)[0] handler = self.handlers_by_topics.get(topic) if not handler: logger.error(f"Handler is not found, {timer_key=}")