Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ permissions:

jobs:
lint:
strategy:
matrix:
cmd: ["black", "ruff", "mypy"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
Expand All @@ -36,7 +33,7 @@ jobs:
- name: Install deps
run: uv sync --all-extras
- name: Run lint check
run: uv run pre-commit run -a ${{ matrix.cmd }}
run: uv run prek run -a
pytest:
strategy:
matrix:
Expand Down
31 changes: 10 additions & 21 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-ast

- repo: builtin
hooks:
- id: trailing-whitespace
- id: check-toml
- id: end-of-file-fixer

- repo: https://github.com/asottile/add-trailing-comma

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the same thing as ruff COM rules (they already enabled). So I removed it

rev: v4.0.0
hooks:
- id: add-trailing-comma

- repo: https://github.com/crate-ci/typos
rev: v1.38.1
rev: v1.50.2
hooks:
- id: typos

Expand All @@ -29,6 +25,12 @@ repos:
'--exclude-lines', 'amqp://guest:guest@localhost:5672',
]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.16.7
hooks:
- id: ruff-check
args: [ "taskiq", "tests", "docs/examples" ]

- repo: local
hooks:
- id: black
Expand All @@ -37,19 +39,6 @@ repos:
language: system
types: [python]

- id: ruff
name: Run ruff lints
entry: uv run ruff
language: system
pass_filenames: false
types: [python]
args:
- "check"
- "--fix"
- "taskiq"
- "tests"
- "docs/examples"

- id: mypy
name: Validate types with MyPy
entry: uv run mypy
Expand Down
20 changes: 10 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,24 +69,24 @@ zmq = ["pyzmq>=26"]

[dependency-groups]
dev = [
"black>=25.11.0",
"coverage>=7.11.3",
"freezegun>=1.5.5",
"prek>=0.5.3",
# type check
"mypy>=1.18.2",
"opentelemetry-test-utils (>=0.59b0,<1)",
"polyfactory>=3.1.0",
"pre-commit>=4.4.0",
# test
"pytest>=9.0.1",
"pytest-cov>=7.0.0",
"pytest-xdist[psutil]>=3.8.0",
"coverage>=7.11.3",
"freezegun>=1.5.5",
"polyfactory>=3.1.0",
"opentelemetry-test-utils (>=0.59b0,<1)",
# lint
"ruff>=0.16.5",
"ruff>=0.16.7",
"black>=26.5.1",
# tests with all python versions
"tox>=4.32.0",
"tox-uv>=1.29.0",
"tzdata>=2025.2; sys_platform == 'win32'"
"tox>=4.61.4",
"tox-uv>=1.36.0",
"tzdata>=2026.4; sys_platform == 'win32'",
]

[build-system]
Expand Down
2 changes: 1 addition & 1 deletion taskiq/cli/scheduler/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ def _is_schedule_ready_to_send(

return is_ready_to_send

async def run(

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess I missed this part in previously merged MRs somwhere. So now on master pre-commit hooks is red. I want to fix it.

async def run( # noqa: C901
self,
*,
update_interval: timedelta | None = None,
Expand Down
20 changes: 15 additions & 5 deletions tests/cli/scheduler/test_send_with_timeout.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ def __init__(self, hang_seconds: float = 60.0) -> None:
self.on_ready_calls = 0

async def on_ready( # type: ignore[override]
self, source: ScheduleSource, task: ScheduledTask
self,
source: ScheduleSource,
task: ScheduledTask,
) -> None:
self.on_ready_calls += 1
await asyncio.sleep(self.hang_seconds)
Expand Down Expand Up @@ -98,7 +100,9 @@ def __init__(self) -> None:
self.calls = 0

async def on_ready( # type: ignore[override]
self, source: ScheduleSource, task: ScheduledTask
self,
source: ScheduleSource,
task: ScheduledTask,
) -> None:
self.calls += 1

Expand Down Expand Up @@ -131,7 +135,9 @@ def __init__(self) -> None:
super().__init__(broker=InMemoryBroker(), sources=[_StubSource()])

async def on_ready( # type: ignore[override]
self, source: ScheduleSource, task: ScheduledTask
self,
source: ScheduleSource,
task: ScheduledTask,
) -> None:
raise RuntimeError("boom")

Expand All @@ -153,7 +159,9 @@ def __init__(self) -> None:
super().__init__(broker=InMemoryBroker(), sources=[_StubSource()])

async def on_ready( # type: ignore[override]
self, source: ScheduleSource, task: ScheduledTask
self,
source: ScheduleSource,
task: ScheduledTask,
) -> None:
try:
await asyncio.sleep(30.0)
Expand Down Expand Up @@ -184,7 +192,9 @@ def __init__(self) -> None:
self.calls: list[Any] = []

async def on_ready( # type: ignore[override]
self, source: ScheduleSource, task: ScheduledTask
self,
source: ScheduleSource,
task: ScheduledTask,
) -> None:
self.calls.append((source, task))

Expand Down
Loading
Loading