Skip to content

Commit 9cef8ac

Browse files
committed
Made some updates.
* Made automatic versioning * Fixed types for pipeliner. * Updated pre-commit config.
1 parent 5e5f58b commit 9cef8ac

11 files changed

Lines changed: 258 additions & 145 deletions

File tree

.github/workflows/release.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ jobs:
1414

1515
steps:
1616
- name: Checkout
17-
uses: actions/checkout@v5
17+
uses: actions/checkout@v6
1818
with:
1919
persist-credentials: false
20+
fetch-depth: 0
2021

2122
- name: Install uv
2223
uses: astral-sh/setup-uv@v7
@@ -25,11 +26,6 @@ jobs:
2526
enable-cache: true
2627
cache-suffix: release-py3.14
2728
python-version: 3.14
28-
- name: Set version from tag
29-
shell: bash
30-
run: |
31-
VERSION="${GITHUB_REF_NAME#v}"
32-
uv version "$VERSION" --frozen
3329

3430
- name: Build package
3531
run: uv build --no-sources

.github/workflows/test.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ jobs:
99
cmd: [ "black", "ruff-check", "mypy" ]
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v5
12+
- uses: actions/checkout@v6
1313
with:
1414
persist-credentials: false
15+
fetch-depth: 0
1516
- id: setup-uv
1617
uses: astral-sh/setup-uv@v7
1718
with:
@@ -31,9 +32,10 @@ jobs:
3132
os: [ ubuntu-latest, windows-latest, macos-latest ]
3233
runs-on: "${{ matrix.os }}"
3334
steps:
34-
- uses: actions/checkout@v5
35+
- uses: actions/checkout@v6
3536
with:
3637
persist-credentials: false
38+
fetch-depth: 0
3739
- id: setup-uv
3840
uses: astral-sh/setup-uv@v7
3941
with:

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ repos:
2323
- id: add-trailing-comma
2424

2525
- repo: https://github.com/crate-ci/typos
26-
rev: v1
26+
rev: v1.45.1
2727
hooks:
2828
- id: typos
2929

@@ -33,19 +33,19 @@ repos:
3333
- id: detect-secrets
3434

3535
- repo: https://github.com/astral-sh/uv-pre-commit
36-
rev: 0.11.2
36+
rev: 0.11.7
3737
hooks:
3838
- id: uv-lock
3939

4040
- repo: https://github.com/astral-sh/ruff-pre-commit
41-
rev: v0.15.8
41+
rev: v0.15.11
4242
hooks:
4343
- id: ruff-format
4444
- id: ruff-check
4545
args: [ --fix, --unsafe-fixes ]
4646

4747
- repo: https://github.com/pre-commit/mirrors-mypy
48-
rev: 'v1.19.1'
48+
rev: 'v1.20.1'
4949
hooks:
5050
- id: mypy
5151
additional_dependencies: [ "no_implicit_optional" ]

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ async def main():
7575
.map(add_one) # Here we execute given function for each value.
7676
# [3, 3, 3, 3]
7777
.filter(check) # Here we filter some values.
78-
# But sice our filter filters out all numbers less than zero,
78+
# But since our filter filters out all numbers less than zero,
7979
# our value won't change.
8080
# [3, 3, 3, 3]
8181
)
@@ -101,7 +101,7 @@ Two notable things here:
101101
2. We can use only tasks as functions we wan to execute in pipeline.
102102
If you want to execute ordinary python function - you must wrap it in task.
103103

104-
Pipeline itself is just a convinient wrapper over list of steps.
104+
Pipeline itself is just a convenient wrapper over list of steps.
105105
Constructed pipeline has the same semantics as the ordinary task, and you can add steps
106106
manually. But all steps of the pipeline must implement `taskiq_pipelines.abc.AbstractStep` class.
107107

pyproject.toml

Lines changed: 84 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,131 +1,125 @@
11
[project]
22
name = "taskiq-pipelines"
3-
version = "0.0.1"
43
description = "Taskiq pipelines for task chaining."
5-
authors = [{ name = "Pavel Kirilin", email = "<win10@list.ru>" }]
6-
maintainers = [{ name = "Pavel Kirilin", email = "<win10@list.ru>" }]
74
readme = "README.md"
8-
repository = "https://github.com/taskiq-python/taskiq-pipelines"
5+
requires-python = ">=3.10,<4"
96
license = "MIT"
107
license-files = ["LICENSE"]
8+
authors = [{ name = "Pavel Kirilin", email = "s3riussan@gmail.com" }]
9+
maintainers = [{ name = "Pavel Kirilin", email = "s3riussan@gmail.com" }]
10+
keywords = ["async", "distributed", "pipelines", "taskiq", "tasks"]
1111
classifiers = [
12-
"Typing :: Typed",
13-
"Programming Language :: Python",
14-
"Programming Language :: Python :: 3",
15-
"Programming Language :: Python :: 3 :: Only",
16-
"Programming Language :: Python :: 3.10",
17-
"Programming Language :: Python :: 3.11",
18-
"Programming Language :: Python :: 3.12",
19-
"Programming Language :: Python :: 3.13",
20-
"Operating System :: OS Independent",
21-
"Intended Audience :: Developers",
22-
"Topic :: System :: Networking",
23-
"Development Status :: 3 - Alpha",
12+
"Development Status :: 3 - Alpha",
13+
"Intended Audience :: Developers",
14+
"Operating System :: OS Independent",
15+
"Programming Language :: Python",
16+
"Programming Language :: Python :: 3",
17+
"Programming Language :: Python :: 3 :: Only",
18+
"Programming Language :: Python :: 3.10",
19+
"Programming Language :: Python :: 3.11",
20+
"Programming Language :: Python :: 3.12",
21+
"Programming Language :: Python :: 3.13",
22+
"Topic :: System :: Networking",
23+
"Typing :: Typed",
2424
]
25-
homepage = "https://github.com/taskiq-python/taskiq-pipelines"
26-
keywords = ["taskiq", "pipelines", "tasks", "distributed", "async"]
27-
28-
requires-python = ">=3.10,<4"
29-
3025
dependencies = [
31-
"taskiq>=0.11.12,<1",
32-
"typing-extensions>=4.3.0,<5",
33-
"pydantic>=2,<3",
26+
"pydantic>=2,<3",
27+
"taskiq>=0.11.12,<1",
28+
"typing-extensions>=4.3.0,<5",
3429
]
30+
dynamic = ["version"]
31+
32+
[project.urls]
33+
Homepage = "https://github.com/taskiq-python/taskiq-pipelines"
34+
Repository = "https://github.com/taskiq-python/taskiq-pipelines"
3535

3636
[dependency-groups]
3737
dev = [
38-
"pytest>=9.0.2",
39-
"black>=26.3.1",
40-
"pytest-cov>=7.1.0",
41-
"anyio>=4",
42-
"pre-commit>=4",
43-
"mypy>=1",
44-
"pytest-xdist[psutil]>=3",
45-
"ruff>=0.15.0",
38+
"anyio>=4",
39+
"black>=26.3.1",
40+
"mypy>=1",
41+
"pre-commit>=4",
42+
"pytest>=9.0.2",
43+
"pytest-cov>=7.1.0",
44+
"pytest-xdist[psutil]>=3",
45+
"ruff>=0.15.0",
4646
]
4747

48-
[project.urls]
49-
Repository = "https://github.com/taskiq-python/taskiq-pipelines"
48+
[build-system]
49+
requires = ["hatchling", "versioningit"]
50+
build-backend = "hatchling.build"
5051

52+
[tool.hatch.version]
53+
source = "versioningit"
54+
55+
[tool.isort]
56+
profile = "black"
57+
multi_line_output = 3
5158

5259
[tool.mypy]
5360
strict = true
5461
ignore_missing_imports = true
55-
allow_subclassing_any = true
56-
allow_untyped_calls = true
62+
disallow_subclassing_any = false
63+
disallow_untyped_calls = false
5764
pretty = true
58-
show_error_codes = true
5965
implicit_reexport = true
6066
allow_untyped_decorators = true
6167
warn_return_any = false
6268
warn_unused_ignores = false
6369

64-
[tool.isort]
65-
profile = "black"
66-
multi_line_output = 3
67-
68-
[build-system]
69-
requires = ["uv_build>=0.11.0,<0.12.0"]
70-
build-backend = "uv_build"
71-
72-
[tool.uv.build-backend]
73-
module-name = "taskiq_pipelines"
74-
module-root = ""
75-
7670
[tool.ruff]
7771
# List of enabled rulsets.
7872
# See https://docs.astral.sh/ruff/rules/ for more information.
7973
lint.select = [
80-
"E", # Error
81-
"F", # Pyflakes
82-
"W", # Pycodestyle
83-
"C90", # McCabe complexity
84-
"I", # Isort
85-
"N", # pep8-naming
86-
"D", # Pydocstyle
87-
"ANN", # Pytype annotations
88-
"S", # Bandit
89-
"B", # Bugbear
90-
"COM", # Commas
91-
"C4", # Comprehensions
92-
"ISC", # Implicit string concat
93-
"PIE", # Unnecessary code
94-
"T20", # Catch prints
95-
"PYI", # validate pyi files
96-
"Q", # Checks for quotes
97-
"RSE", # Checks raise statements
98-
"RET", # Checks return statements
99-
"SLF", # Self checks
100-
"SIM", # Simplificator
101-
"PTH", # Pathlib checks
102-
"ERA", # Checks for commented out code
103-
"PL", # PyLint checks
104-
"RUF", # Specific to Ruff checks
74+
"E", # Error
75+
"F", # Pyflakes
76+
"W", # Pycodestyle
77+
"C90", # McCabe complexity
78+
"I", # Isort
79+
"N", # pep8-naming
80+
"D", # Pydocstyle
81+
"ANN", # Pytype annotations
82+
"S", # Bandit
83+
"B", # Bugbear
84+
"COM", # Commas
85+
"C4", # Comprehensions
86+
"ISC", # Implicit string concat
87+
"PIE", # Unnecessary code
88+
"T20", # Catch prints
89+
"PYI", # validate pyi files
90+
"Q", # Checks for quotes
91+
"RSE", # Checks raise statements
92+
"RET", # Checks return statements
93+
"SLF", # Self checks
94+
"SIM", # Simplificator
95+
"PTH", # Pathlib checks
96+
"ERA", # Checks for commented out code
97+
"PL", # PyLint checks
98+
"RUF", # Specific to Ruff checks
10599
]
106100
lint.ignore = [
107-
"D105", # Missing docstring in magic method
108-
"D107", # Missing docstring in __init__
109-
"D212", # Multi-line docstring summary should start at the first line
110-
"D401", # First line should be in imperative mood
111-
"D104", # Missing docstring in public package
112-
"D100", # Missing docstring in public module
113-
"ANN401", # typing.Any are disallowed in `**kwargs
114-
"PLR0913", # Too many arguments for function call
115-
"D106", # Missing docstring in public nested class
116-
"SLF001", # Private member accessed
101+
"D105", # Missing docstring in magic method
102+
"D107", # Missing docstring in __init__
103+
"D212", # Multi-line docstring summary should start at the first line
104+
"D401", # First line should be in imperative mood
105+
"D104", # Missing docstring in public package
106+
"D100", # Missing docstring in public module
107+
"ANN401", # typing.Any are disallowed in `**kwargs
108+
"PLR0913", # Too many arguments for function call
109+
"D106", # Missing docstring in public nested class
110+
"SLF001", # Private member accessed
117111
]
118112
lint.mccabe = { max-complexity = 10 }
119113
line-length = 88
120114

121115
[tool.ruff.lint.per-file-ignores]
122116
"tests/*" = [
123-
"S101", # Use of assert detected
124-
"S301", # Use of pickle detected
125-
"D103", # Missing docstring in public function
126-
"SLF001", # Private member accessed
127-
"S311", # Standard pseudo-random generators are not suitable for security/cryptographic purposes
128-
"D101", # Missing docstring in public class
117+
"S101", # Use of assert detected
118+
"S301", # Use of pickle detected
119+
"D103", # Missing docstring in public function
120+
"SLF001", # Private member accessed
121+
"S311", # Standard pseudo-random generators are not suitable for security/cryptographic purposes
122+
"D101", # Missing docstring in public class
129123
]
130124

131125
[tool.ruff.lint.pydocstyle]

taskiq_pipelines/exceptions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ class FilterError(StepError):
3333

3434
class AbortPipeline(PipelineError): # noqa: N818
3535
"""
36-
Abort curret pipeline execution.
36+
Abort current pipeline execution.
3737
3838
This error can be thrown from
3939
act method of a step.
4040
41-
It imediately aborts current pipeline
41+
It immediately aborts current pipeline
4242
execution.
4343
"""
4444

taskiq_pipelines/middleware.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ async def post_save( # noqa: PLR0911
3838
return
3939
current_step_num = int(message.labels[CURRENT_STEP])
4040
if PIPELINE_DATA not in message.labels:
41-
logger.warning("Pipline data not found. Execution flow is broken.")
41+
logger.warning("Pipeline data not found. Execution flow is broken.")
4242
return
4343
pipeline_data = message.labels[PIPELINE_DATA]
4444
parsed_data = self.broker.serializer.loadb(pipeline_data)
@@ -47,7 +47,7 @@ async def post_save( # noqa: PLR0911
4747
parsed_data,
4848
)
4949
except ValueError as err:
50-
logger.warning("Cannot parse pipline_data: %s", err, exc_info=True)
50+
logger.warning("Cannot parse pipeline_data: %s", err, exc_info=True)
5151
return
5252
if current_step_num + 1 >= len(steps_data):
5353
logger.debug("Pipeline is completed.")
@@ -99,7 +99,7 @@ async def on_error(
9999
return
100100
current_step_num = int(message.labels[CURRENT_STEP])
101101
if PIPELINE_DATA not in message.labels:
102-
logger.warning("Pipline data not found. Execution flow is broken.")
102+
logger.warning("Pipeline data not found. Execution flow is broken.")
103103
return
104104
pipe_data = message.labels[PIPELINE_DATA]
105105
try:

0 commit comments

Comments
 (0)