Skip to content

Commit 8940863

Browse files
committed
refactor: remove support for deprecated Python versions and move to uv
1 parent b720884 commit 8940863

File tree

7 files changed

+1870
-1390
lines changed

7 files changed

+1870
-1390
lines changed

.github/workflows/release.yml

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
11
name: Release python package
22

33
on:
4-
push:
5-
tags:
6-
- "*"
4+
release:
5+
types:
6+
- released
77

88
jobs:
99
deploy:
1010
runs-on: ubuntu-latest
11+
permissions:
12+
id-token: write
1113
steps:
12-
- uses: actions/checkout@v4
13-
- name: Install poetry
14-
run: pipx install poetry
15-
- name: Set up Python
16-
uses: actions/setup-python@v4
14+
- uses: actions/checkout@v5
1715
with:
18-
python-version: "3.11"
19-
- name: Install deps
20-
run: poetry install
16+
persist-credentials: false
17+
- uses: astral-sh/setup-uv@v7
18+
with:
19+
enable-cache: false
20+
python-version: "3.12"
21+
version: "latest"
22+
- run: uv version "${GITHUB_REF_NAME}"
23+
- run: uv build
2124
- name: Release package
2225
env:
23-
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
24-
run: poetry publish --build
26+
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }}
27+
run: uv publish

.github/workflows/test.yml

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
11
name: Testing package
22

3-
on: push
3+
on:
4+
release:
5+
types:
6+
- released
47

58
jobs:
69
lint:
710
strategy:
811
matrix:
9-
cmd:
10-
- black
11-
- mypy
12-
- ruff
12+
cmd: [ "black", "ruff", "mypy" ]
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v4
16-
- name: Install poetry
17-
run: pipx install poetry
18-
- name: Set up Python
19-
uses: actions/setup-python@v4
15+
- uses: actions/checkout@v5
2016
with:
21-
python-version: "3.11"
22-
cache: "poetry"
17+
persist-credentials: false
18+
- id: setup-uv
19+
uses: astral-sh/setup-uv@v7
20+
with:
21+
enable-cache: true
22+
cache-suffix: "3.12"
23+
version: "latest"
24+
python-version: "3.12"
2325
- name: Install deps
24-
run: poetry install
26+
run: uv sync --all-extras
2527
- name: Run lint check
26-
run: poetry run pre-commit run -a ${{ matrix.cmd }}
28+
run: uv run pre-commit run -a ${{ matrix.cmd }}

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,21 @@ repos:
1818
hooks:
1919
- id: black
2020
name: Format with Black
21-
entry: poetry run black
21+
entry: uv run black
2222
language: system
2323
types: [python]
2424

2525
- id: mypy
2626
name: Validate types with MyPy
27-
entry: poetry run mypy
27+
entry: uv run mypy
2828
language: system
2929
types: [python]
3030
pass_filenames: false
3131
args: [taskiq_litestar]
3232

3333
- id: ruff
3434
name: Run ruff lints
35-
entry: poetry run ruff
35+
entry: uv run ruff
3636
language: system
3737
pass_filenames: false
3838
types: [python]

poetry.lock

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

pyproject.toml

Lines changed: 65 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,47 @@
1-
[tool.poetry]
1+
[project]
22
name = "taskiq-litestar"
33
description = "Taskiq integration with litestar"
4-
authors = ["Taskiq team <[email protected]>"]
5-
maintainers = ["Taskiq team <[email protected]>"]
4+
authors = [
5+
{ name = "Taskiq team", email = "[email protected]" }
6+
]
7+
maintainers = [
8+
{ name = "Taskiq team", email = "[email protected]" }
9+
]
610
version = "0.1.1"
711
readme = "README.md"
8-
license = "LICENSE"
12+
requires-python = ">=3.10"
13+
license = "MIT"
14+
license-files = ["LICENSE"]
915
classifiers = [
1016
"Typing :: Typed",
1117
"Programming Language :: Python",
1218
"Programming Language :: Python :: 3",
1319
"Programming Language :: Python :: 3 :: Only",
14-
"Programming Language :: Python :: 3.8",
15-
"Programming Language :: Python :: 3.9",
1620
"Programming Language :: Python :: 3.10",
1721
"Programming Language :: Python :: 3.11",
22+
"Programming Language :: Python :: 3.12",
23+
"Programming Language :: Python :: 3.13",
1824
"Operating System :: OS Independent",
1925
"Intended Audience :: Developers",
2026
"Topic :: System :: Networking",
2127
"Development Status :: 3 - Alpha",
2228
]
2329
keywords = ["taskiq", "tasks", "distributed", "async", "litestar"]
24-
packages = [{ include = "taskiq_litestar" }]
25-
26-
[tool.poetry.dependencies]
27-
python = "^3.8.1"
28-
taskiq = "^0"
29-
litestar = "^2"
30+
dependencies = [
31+
"litestar>=2.18.0",
32+
"taskiq>=0.12.0",
33+
]
3034

31-
[tool.poetry.group.dev.dependencies]
32-
mypy = "^1"
33-
pre-commit = "^2.20.0"
34-
black = "^23.1.0"
35-
ruff = "^0.0.292"
35+
[project.optional-dependencies]
36+
dev = [
37+
"black>=25.11.0",
38+
"coverage>=7.12.0",
39+
"mypy>=1.19.0",
40+
"pre-commit>=4.5.0",
41+
"pytest>=9.0.1",
42+
"pytest-cov>=7.0.0",
43+
"ruff>=0.14.7",
44+
]
3645

3746
[tool.mypy]
3847
strict = true
@@ -47,57 +56,64 @@ warn_return_any = false
4756
warn_unused_ignores = false
4857

4958
[build-system]
50-
requires = ["poetry-core"]
51-
build-backend = "poetry.core.masonry.api"
59+
requires = ["uv_build>=0.9.13,<0.10.0"]
60+
build-backend = "uv_build"
61+
62+
[tool.uv.build-backend]
63+
module-root = ""
64+
module-name = "taskiq_litestar"
5265

5366
[tool.ruff]
5467
# List of enabled rulsets.
5568
# See https://docs.astral.sh/ruff/rules/ for more information.
56-
select = [
57-
"E", # Error
58-
"F", # Pyflakes
59-
"W", # Pycodestyle
69+
line-length = 88
70+
71+
lint.select = [
72+
"E", # Error
73+
"F", # Pyflakes
74+
"W", # Pycodestyle
6075
"C90", # McCabe complexity
61-
"I", # Isort
62-
"N", # pep8-naming
63-
"D", # Pydocstyle
76+
"I", # Isort
77+
"N", # pep8-naming
78+
"D", # Pydocstyle
6479
"ANN", # Pytype annotations
65-
"S", # Bandit
66-
"B", # Bugbear
80+
"S", # Bandit
81+
"B", # Bugbear
6782
"COM", # Commas
68-
"C4", # Comprehensions
83+
"C4", # Comprehensions
6984
"ISC", # Implicit string concat
7085
"PIE", # Unnecessary code
7186
"T20", # Catch prints
7287
"PYI", # validate pyi files
73-
"Q", # Checks for quotes
88+
"Q", # Checks for quotes
7489
"RSE", # Checks raise statements
7590
"RET", # Checks return statements
7691
"SLF", # Self checks
7792
"SIM", # Simplificator
7893
"PTH", # Pathlib checks
7994
"ERA", # Checks for commented out code
80-
"PL", # PyLint checks
95+
"PL", # PyLint checks
8196
"RUF", # Specific to Ruff checks
97+
"FA102", # Future annotations
98+
"UP", # Pyupgrade
8299
]
83-
ignore = [
84-
"D105", # Missing docstring in magic method
85-
"D107", # Missing docstring in __init__
86-
"D212", # Multi-line docstring summary should start at the first line
87-
"D401", # First line should be in imperative mood
88-
"D104", # Missing docstring in public package
89-
"D100", # Missing docstring in public module
90-
"ANN102", # Missing type annotation for self in method
91-
"ANN101", # Missing type annotation for argument
92-
"ANN401", # typing.Any are disallowed in `**kwargs
100+
lint.ignore = [
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
93108
"PLR0913", # Too many arguments for function call
94-
"D106", # Missing docstring in public nested class
109+
"D106", # Missing docstring in public nested class
95110
]
96111
exclude = [".venv/"]
97-
mccabe = { max-complexity = 10 }
98-
line-length = 88
99112

100-
[tool.ruff.per-file-ignores]
113+
[tool.ruff.lint.mccabe]
114+
max-complexity = 10
115+
116+
[tool.ruff.lint.per-file-ignores]
101117
"tests/*" = [
102118
"S101", # Use of assert detected
103119
"S301", # Use of pickle detected
@@ -107,14 +123,14 @@ line-length = 88
107123
"D101", # Missing docstring in public class
108124
]
109125

110-
[tool.ruff.pydocstyle]
126+
[tool.ruff.lint.pydocstyle]
111127
convention = "pep257"
112128
ignore-decorators = ["typing.overload"]
113129

114-
[tool.ruff.pylint]
115-
allow-magic-value-types = ["int", "str", "float", "tuple"]
130+
[tool.ruff.lint.pylint]
131+
allow-magic-value-types = ["int", "str", "float"]
116132

117-
[tool.ruff.flake8-bugbear]
133+
[tool.ruff.lint.flake8-bugbear]
118134
extend-immutable-calls = [
119135
"taskiq_dependencies.Depends",
120136
"taskiq.TaskiqDepends",

taskiq_litestar/intializer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import logging
2-
from typing import Awaitable, Callable
2+
from collections.abc import Awaitable, Callable
33

44
from litestar import Litestar
55
from litestar.datastructures import State

0 commit comments

Comments
 (0)