Skip to content

Commit a226262

Browse files
authored
Merge pull request #4 from vldmrdev/3-remove-depricated-python-versions
chore: remove support for deprecated Python versions and move to uv
2 parents b720884 + 00c9fe3 commit a226262

7 files changed

Lines changed: 1858 additions & 1370 deletions

File tree

.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: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,36 @@
11
name: Testing package
22

3-
on: push
3+
on:
4+
pull_request:
5+
paths-ignore:
6+
- '*.md'
7+
push:
8+
paths-ignore:
9+
- '*.md'
10+
11+
permissions:
12+
actions: read
13+
contents: read
14+
pull-requests: read
415

516
jobs:
617
lint:
718
strategy:
819
matrix:
9-
cmd:
10-
- black
11-
- mypy
12-
- ruff
20+
cmd: [ "black", "ruff", "mypy" ]
1321
runs-on: ubuntu-latest
1422
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
23+
- uses: actions/checkout@v5
24+
with:
25+
persist-credentials: false
26+
- id: setup-uv
27+
uses: astral-sh/setup-uv@v7
2028
with:
21-
python-version: "3.11"
22-
cache: "poetry"
29+
enable-cache: true
30+
cache-suffix: "3.12"
31+
version: "latest"
32+
python-version: 3.12
2333
- name: Install deps
24-
run: poetry install
34+
run: uv sync --all-extras
2535
- name: Run lint check
26-
run: poetry run pre-commit run -a ${{ matrix.cmd }}
36+
run: uv run pre-commit run -a ${{ matrix.cmd }}

.pre-commit-config.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,25 @@ 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]
3939
args:
40+
- "check"
4041
- "--fix"
4142
- "taskiq_litestar"

poetry.lock

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

pyproject.toml

Lines changed: 44 additions & 29 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 <taskiq@no-reply.com>"]
5-
maintainers = ["Taskiq team <taskiq@no-reply.com>"]
4+
authors = [
5+
{ name = "Taskiq team", email = "taskiq@no-reply.com" }
6+
]
7+
maintainers = [
8+
{ name = "Taskiq team", email = "taskiq@no-reply.com" }
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,13 +56,17 @@ 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 = [
69+
lint.select = [
5770
"E", # Error
5871
"F", # Pyflakes
5972
"W", # Pycodestyle
@@ -79,25 +92,27 @@ select = [
7992
"ERA", # Checks for commented out code
8093
"PL", # PyLint checks
8194
"RUF", # Specific to Ruff checks
95+
"FA102", # Future annotations
96+
"UP", # Pyupgrade
8297
]
83-
ignore = [
98+
lint.ignore = [
8499
"D105", # Missing docstring in magic method
85100
"D107", # Missing docstring in __init__
86101
"D212", # Multi-line docstring summary should start at the first line
87102
"D401", # First line should be in imperative mood
88103
"D104", # Missing docstring in public package
89104
"D100", # Missing docstring in public module
90-
"ANN102", # Missing type annotation for self in method
91-
"ANN101", # Missing type annotation for argument
92105
"ANN401", # typing.Any are disallowed in `**kwargs
93106
"PLR0913", # Too many arguments for function call
94107
"D106", # Missing docstring in public nested class
95108
]
96109
exclude = [".venv/"]
97-
mccabe = { max-complexity = 10 }
98110
line-length = 88
99111

100-
[tool.ruff.per-file-ignores]
112+
[tool.ruff.lint.mccabe]
113+
max-complexity = 10
114+
115+
[tool.ruff.lint.per-file-ignores]
101116
"tests/*" = [
102117
"S101", # Use of assert detected
103118
"S301", # Use of pickle detected
@@ -107,14 +122,14 @@ line-length = 88
107122
"D101", # Missing docstring in public class
108123
]
109124

110-
[tool.ruff.pydocstyle]
125+
[tool.ruff.lint.pydocstyle]
111126
convention = "pep257"
112127
ignore-decorators = ["typing.overload"]
113128

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

117-
[tool.ruff.flake8-bugbear]
132+
[tool.ruff.lint.flake8-bugbear]
118133
extend-immutable-calls = [
119134
"taskiq_dependencies.Depends",
120135
"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)