Skip to content

Commit 70e3fe0

Browse files
committed
fix: lint
fix: action update: git action del: poetry add: uv update: pre-commit hooks
1 parent ef097a5 commit 70e3fe0

File tree

8 files changed

+1779
-1169
lines changed

8 files changed

+1779
-1169
lines changed

.github/workflows/test.yml

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,42 +6,44 @@ jobs:
66
lint:
77
strategy:
88
matrix:
9-
cmd:
10-
- black
11-
- ruff
12-
- mypy
9+
cmd: [ "black", "ruff-check", "mypy" ]
1310
runs-on: ubuntu-latest
1411
steps:
15-
- uses: actions/checkout@v2
16-
- name: Install poetry
17-
run: pipx install poetry
18-
- name: Set up Python
19-
uses: actions/setup-python@v4
12+
- uses: actions/checkout@v5
2013
with:
21-
python-version: "3.11"
22-
cache: "poetry"
14+
persist-credentials: false
15+
- id: setup-uv
16+
uses: astral-sh/setup-uv@v7
17+
with:
18+
enable-cache: true
19+
cache-suffix: 3.11
20+
version: "latest"
21+
python-version: 3.11
2322
- name: Install deps
24-
run: poetry install --all-extras
23+
run: uv sync --all-extras
2524
- name: Run lint check
26-
run: poetry run pre-commit run -a ${{ matrix.cmd }}
25+
run: uv run pre-commit run -a ${{ matrix.cmd }}
2726
pytest:
2827
strategy:
2928
matrix:
30-
py_version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
31-
runs-on: "ubuntu-latest"
29+
py_version: [ "3.10", "3.11", "3.12", "3.13", "3.14" ]
30+
pydantic_ver: [ "<2", ">=2.5,<3" ]
31+
os: [ ubuntu-latest, windows-latest, macos-latest ]
32+
runs-on: "${{ matrix.os }}"
3233
steps:
33-
- uses: actions/checkout@v2
34-
- name: Set up Python
35-
uses: actions/setup-python@v2
34+
- uses: actions/checkout@v5
35+
with:
36+
persist-credentials: false
37+
- id: setup-uv
38+
uses: astral-sh/setup-uv@v7
3639
with:
37-
python-version: "${{ matrix.py_version }}"
38-
- name: Update pip
39-
run: python -m pip install -U pip
40-
- name: Install poetry
41-
run: python -m pip install poetry
40+
enable-cache: true
41+
cache-suffix: ${{ matrix.py_version }}
42+
version: "latest"
43+
python-version: ${{ matrix.py_version }}
4244
- name: Install deps
43-
run: poetry install
44-
env:
45-
POETRY_VIRTUALENVS_CREATE: false
45+
run: uv sync --all-extras
46+
- name: Setup pydantic version
47+
run: uv pip install "pydantic ${{ matrix.pydantic_ver }}"
4648
- name: Run pytest check
47-
run: poetry run pytest -vv -n auto --cov="taskiq_pipelines" .
49+
run: uv run pytest -vv -n auto .

.pre-commit-config.yaml

Lines changed: 42 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,60 @@
11
# See https://pre-commit.com for more information
22
# See https://pre-commit.com/hooks.html for more hooks
3+
34
repos:
45
- repo: https://github.com/pre-commit/pre-commit-hooks
5-
rev: v2.4.0
6+
rev: v6.0.0
67
hooks:
7-
- id: check-ast
8-
- id: trailing-whitespace
8+
- id: check-added-large-files
9+
- id: pretty-format-json
10+
args:
11+
- "--indent=2"
12+
- "--autofix"
13+
- id: check-json
14+
- id: check-yaml
15+
exclude: .github/
916
- id: check-toml
1017
- id: end-of-file-fixer
18+
- id: trailing-whitespace
1119

1220
- repo: https://github.com/asottile/add-trailing-comma
13-
rev: v2.1.0
21+
rev: v4.0.0
1422
hooks:
1523
- id: add-trailing-comma
1624

17-
- repo: local
25+
- repo: https://github.com/crate-ci/typos
26+
rev: v1
1827
hooks:
19-
- id: black
20-
name: Format with Black
21-
entry: poetry run black
22-
language: system
23-
types: [python]
28+
- id: typos
2429

25-
- id: ruff
26-
name: Run ruff lints
27-
entry: poetry run ruff
28-
language: system
29-
pass_filenames: false
30-
types: [python]
31-
args:
32-
- "check"
33-
- "--fix"
34-
- "."
30+
- repo: https://github.com/Yelp/detect-secrets
31+
rev: v1.5.0
32+
hooks:
33+
- id: detect-secrets
34+
35+
- repo: https://github.com/astral-sh/uv-pre-commit
36+
rev: 0.11.2
37+
hooks:
38+
- id: uv-lock
3539

40+
- repo: https://github.com/astral-sh/ruff-pre-commit
41+
rev: v0.15.8
42+
hooks:
43+
- id: ruff-format
44+
- id: ruff-check
45+
args: [ --fix, --unsafe-fixes ]
46+
47+
- repo: https://github.com/pre-commit/mirrors-mypy
48+
rev: 'v1.19.1'
49+
hooks:
3650
- id: mypy
37-
name: Validate types with MyPy
38-
entry: poetry run mypy
51+
additional_dependencies: [ "no_implicit_optional" ]
52+
args: [ "--config-file=pyproject.toml", "--install-types", "--non-interactive" ]
53+
54+
- repo: local
55+
hooks:
56+
- id: black
57+
name: Format with Black
58+
entry: uv run black
3959
language: system
4060
types: [python]

poetry.lock

Lines changed: 0 additions & 991 deletions
This file was deleted.

pyproject.toml

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
[tool.poetry]
1+
[project]
22
name = "taskiq-pipelines"
3-
# The version is set automatically by the CI/CD pipeline
43
version = "0.0.0"
54
description = "Taskiq pipelines for task chaining."
6-
authors = ["Pavel Kirilin <win10@list.ru>"]
5+
authors = [{ name = "Pavel Kirilin", email = "<win10@list.ru>" }]
6+
maintainers = [{ name = "Pavel Kirilin", email = "<win10@list.ru>" }]
77
readme = "README.md"
88
repository = "https://github.com/taskiq-python/taskiq-pipelines"
9-
license = "LICENSE"
9+
license = "MIT"
10+
license-files = ["LICENSE"]
1011
classifiers = [
1112
"Typing :: Typed",
1213
"Programming Language :: Python",
1314
"Programming Language :: Python :: 3",
1415
"Programming Language :: Python :: 3 :: Only",
15-
"Programming Language :: Python :: 3.9",
1616
"Programming Language :: Python :: 3.10",
1717
"Programming Language :: Python :: 3.11",
1818
"Programming Language :: Python :: 3.12",
@@ -25,21 +25,29 @@ classifiers = [
2525
homepage = "https://github.com/taskiq-python/taskiq-pipelines"
2626
keywords = ["taskiq", "pipelines", "tasks", "distributed", "async"]
2727

28-
[tool.poetry.dependencies]
29-
python = "^3.9"
30-
taskiq = ">=0.11.12, <1"
31-
typing-extensions = "^4.3.0"
32-
pydantic = "^2"
28+
requires-python = ">=3.10,<4"
29+
30+
dependencies = [
31+
"taskiq>=0.11.12,<1",
32+
"typing-extensions>=4.3.0,<5",
33+
"pydantic>=2,<3",
34+
]
35+
36+
[dependency-groups]
37+
dev = [
38+
"pytest>=9.0.1",
39+
"black>=25.11.0",
40+
"pytest-cov>=7.0.0",
41+
"anyio>=4",
42+
"pre-commit>=4",
43+
"mypy>=1",
44+
"pytest-xdist[psutil]>=3",
45+
"ruff>=0.9.9",
46+
]
47+
48+
[project.urls]
49+
Repository = "https://github.com/taskiq-python/taskiq-pipelines"
3350

34-
[tool.poetry.group.dev.dependencies]
35-
pytest = "^8"
36-
black = { version = "^25", allow-prereleases = true }
37-
pytest-cov = "^6"
38-
anyio = "^4"
39-
pre-commit = "^4"
40-
mypy = "^1"
41-
pytest-xdist = { version = "^3", extras = ["psutil"] }
42-
ruff = "^0.9.9"
4351

4452
[tool.mypy]
4553
strict = true
@@ -58,8 +66,12 @@ profile = "black"
5866
multi_line_output = 3
5967

6068
[build-system]
61-
requires = ["poetry-core>=1.0.0"]
62-
build-backend = "poetry.core.masonry.api"
69+
requires = ["uv_build>=0.9.16,<0.10.0"]
70+
build-backend = "uv_build"
71+
72+
[tool.uv.build-backend]
73+
module-name = "taskiq_pipelines"
74+
module-root = ""
6375

6476
[tool.ruff]
6577
# List of enabled rulsets.

taskiq_pipelines/pipeliner.py

Lines changed: 0 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
1-
from types import CoroutineType
21
from typing import (
32
Any,
4-
Coroutine,
53
Dict,
64
Generic,
75
List,
86
Literal,
97
Optional,
108
TypeVar,
119
Union,
12-
overload,
1310
)
1411

1512
import pydantic
@@ -23,7 +20,6 @@
2320

2421
_ReturnType = TypeVar("_ReturnType")
2522
_FuncParams = ParamSpec("_FuncParams")
26-
_T2 = TypeVar("_T2")
2723

2824

2925
class DumpedStep(pydantic.BaseModel):
@@ -65,30 +61,6 @@ def __init__(
6561
if task:
6662
self.call_next(task)
6763

68-
@overload
69-
def call_next(
70-
self: "Pipeline[_FuncParams, _ReturnType]",
71-
task: Union[
72-
AsyncKicker[Any, Coroutine[Any, Any, _T2]],
73-
AsyncKicker[Any, "CoroutineType[Any, Any, _T2]"],
74-
AsyncTaskiqDecoratedTask[Any, Coroutine[Any, Any, _T2]],
75-
AsyncTaskiqDecoratedTask[Any, "CoroutineType[Any, Any, _T2]"],
76-
],
77-
param_name: Union[Optional[str], Literal[-1]] = None,
78-
**additional_kwargs: Any,
79-
) -> "Pipeline[_FuncParams, _T2]": ...
80-
81-
@overload
82-
def call_next(
83-
self: "Pipeline[_FuncParams, _ReturnType]",
84-
task: Union[
85-
AsyncKicker[Any, _T2],
86-
AsyncTaskiqDecoratedTask[Any, _T2],
87-
],
88-
param_name: Union[Optional[str], Literal[-1]] = None,
89-
**additional_kwargs: Any,
90-
) -> "Pipeline[_FuncParams, _T2]": ...
91-
9264
def call_next(
9365
self,
9466
task: Union[
@@ -126,28 +98,6 @@ def call_next(
12698
)
12799
return self
128100

129-
@overload
130-
def call_after(
131-
self: "Pipeline[_FuncParams, _ReturnType]",
132-
task: Union[
133-
AsyncKicker[Any, Coroutine[Any, Any, _T2]],
134-
AsyncKicker[Any, "CoroutineType[Any, Any, _T2]"],
135-
AsyncTaskiqDecoratedTask[Any, Coroutine[Any, Any, _T2]],
136-
AsyncTaskiqDecoratedTask[Any, "CoroutineType[Any, Any, _T2]"],
137-
],
138-
**additional_kwargs: Any,
139-
) -> "Pipeline[_FuncParams, _T2]": ...
140-
141-
@overload
142-
def call_after(
143-
self: "Pipeline[_FuncParams, _ReturnType]",
144-
task: Union[
145-
AsyncKicker[Any, _T2],
146-
AsyncTaskiqDecoratedTask[Any, _T2],
147-
],
148-
**additional_kwargs: Any,
149-
) -> "Pipeline[_FuncParams, _T2]": ...
150-
151101
def call_after(
152102
self,
153103
task: Union[
@@ -182,34 +132,6 @@ def call_after(
182132
)
183133
return self
184134

185-
@overload
186-
def map(
187-
self: "Pipeline[_FuncParams, _ReturnType]",
188-
task: Union[
189-
AsyncKicker[Any, Coroutine[Any, Any, _T2]],
190-
AsyncKicker[Any, "CoroutineType[Any, Any, _T2]"],
191-
AsyncTaskiqDecoratedTask[Any, Coroutine[Any, Any, _T2]],
192-
AsyncTaskiqDecoratedTask[Any, "CoroutineType[Any, Any, _T2]"],
193-
],
194-
param_name: Optional[str] = None,
195-
skip_errors: bool = False,
196-
check_interval: float = 0.5,
197-
**additional_kwargs: Any,
198-
) -> "Pipeline[_FuncParams, List[_T2]]": ...
199-
200-
@overload
201-
def map(
202-
self: "Pipeline[_FuncParams, _ReturnType]",
203-
task: Union[
204-
AsyncKicker[Any, _T2],
205-
AsyncTaskiqDecoratedTask[Any, _T2],
206-
],
207-
param_name: Optional[str] = None,
208-
skip_errors: bool = False,
209-
check_interval: float = 0.5,
210-
**additional_kwargs: Any,
211-
) -> "Pipeline[_FuncParams, List[_T2]]": ...
212-
213135
def map(
214136
self,
215137
task: Union[
@@ -253,34 +175,6 @@ def map(
253175
)
254176
return self
255177

256-
@overload
257-
def filter(
258-
self: "Pipeline[_FuncParams, _ReturnType]",
259-
task: Union[
260-
AsyncKicker[Any, Coroutine[Any, Any, bool]],
261-
AsyncKicker[Any, "CoroutineType[Any, Any, bool]"],
262-
AsyncTaskiqDecoratedTask[Any, Coroutine[Any, Any, bool]],
263-
AsyncTaskiqDecoratedTask[Any, "CoroutineType[Any, Any, bool]"],
264-
],
265-
param_name: Optional[str] = None,
266-
skip_errors: bool = False,
267-
check_interval: float = 0.5,
268-
**additional_kwargs: Any,
269-
) -> "Pipeline[_FuncParams, _ReturnType]": ...
270-
271-
@overload
272-
def filter(
273-
self: "Pipeline[_FuncParams, _ReturnType]",
274-
task: Union[
275-
AsyncKicker[Any, bool],
276-
AsyncTaskiqDecoratedTask[Any, bool],
277-
],
278-
param_name: Optional[str] = None,
279-
skip_errors: bool = False,
280-
check_interval: float = 0.5,
281-
**additional_kwargs: Any,
282-
) -> "Pipeline[_FuncParams, _ReturnType]": ...
283-
284178
def filter(
285179
self,
286180
task: Union[

0 commit comments

Comments
 (0)