Skip to content
Merged
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
29 changes: 16 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
name: Release python package

on:
push:
tags:
- "*"
release:
types:
- released

jobs:
deploy:
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- name: Set up Python
uses: actions/setup-python@v4
- uses: actions/checkout@v5
with:
python-version: "3.11"
- name: Install deps
run: poetry install
persist-credentials: false
- uses: astral-sh/setup-uv@v7
with:
enable-cache: false
python-version: "3.12"
version: "latest"
- run: uv version "${GITHUB_REF_NAME}"
- run: uv build
- name: Release package
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
run: poetry publish --build
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: uv publish
38 changes: 24 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,36 @@
name: Testing package

on: push
on:
pull_request:
paths-ignore:
- '*.md'
push:
paths-ignore:
- '*.md'

permissions:
actions: read
contents: read
pull-requests: read

jobs:
lint:
strategy:
matrix:
cmd:
- black
- mypy
- ruff
cmd: [ "black", "ruff", "mypy" ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- name: Set up Python
uses: actions/setup-python@v4
- uses: actions/checkout@v5
with:
persist-credentials: false
- id: setup-uv
uses: astral-sh/setup-uv@v7
with:
python-version: "3.11"
cache: "poetry"
enable-cache: true
cache-suffix: "3.12"
version: "latest"
python-version: 3.12
- name: Install deps
run: poetry install
run: uv sync --all-extras
- name: Run lint check
run: poetry run pre-commit run -a ${{ matrix.cmd }}
run: uv run pre-commit run -a ${{ matrix.cmd }}
7 changes: 4 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,25 @@ repos:
hooks:
- id: black
name: Format with Black
entry: poetry run black
entry: uv run black
language: system
types: [python]

- id: mypy
name: Validate types with MyPy
entry: poetry run mypy
entry: uv run mypy
language: system
types: [python]
pass_filenames: false
args: [taskiq_litestar]

- id: ruff
name: Run ruff lints
entry: poetry run ruff
entry: uv run ruff
language: system
pass_filenames: false
types: [python]
args:
- "check"
- "--fix"
- "taskiq_litestar"
1,310 changes: 0 additions & 1,310 deletions poetry.lock

This file was deleted.

73 changes: 44 additions & 29 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,38 +1,47 @@
[tool.poetry]
[project]
name = "taskiq-litestar"
description = "Taskiq integration with litestar"
authors = ["Taskiq team <taskiq@no-reply.com>"]
maintainers = ["Taskiq team <taskiq@no-reply.com>"]
authors = [
{ name = "Taskiq team", email = "taskiq@no-reply.com" }
]
maintainers = [
{ name = "Taskiq team", email = "taskiq@no-reply.com" }
]
version = "0.1.1"
readme = "README.md"
license = "LICENSE"
requires-python = ">=3.10"
license = "MIT"
license-files = ["LICENSE"]
classifiers = [
"Typing :: Typed",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Operating System :: OS Independent",
"Intended Audience :: Developers",
"Topic :: System :: Networking",
"Development Status :: 3 - Alpha",
]
keywords = ["taskiq", "tasks", "distributed", "async", "litestar"]
packages = [{ include = "taskiq_litestar" }]

[tool.poetry.dependencies]
python = "^3.8.1"
taskiq = "^0"
litestar = "^2"
dependencies = [
"litestar>=2.18.0",
"taskiq>=0.12.0",
]

[tool.poetry.group.dev.dependencies]
mypy = "^1"
pre-commit = "^2.20.0"
black = "^23.1.0"
ruff = "^0.0.292"
[project.optional-dependencies]
dev = [
"black>=25.11.0",
"coverage>=7.12.0",
"mypy>=1.19.0",
"pre-commit>=4.5.0",
"pytest>=9.0.1",
"pytest-cov>=7.0.0",
"ruff>=0.14.7",
]

[tool.mypy]
strict = true
Expand All @@ -47,13 +56,17 @@ warn_return_any = false
warn_unused_ignores = false

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
requires = ["uv_build>=0.9.13,<0.10.0"]
build-backend = "uv_build"

[tool.uv.build-backend]
module-root = ""
module-name = "taskiq_litestar"

[tool.ruff]
# List of enabled rulsets.
# See https://docs.astral.sh/ruff/rules/ for more information.
select = [
lint.select = [
"E", # Error
"F", # Pyflakes
"W", # Pycodestyle
Expand All @@ -79,25 +92,27 @@ select = [
"ERA", # Checks for commented out code
"PL", # PyLint checks
"RUF", # Specific to Ruff checks
"FA102", # Future annotations
"UP", # Pyupgrade
]
ignore = [
lint.ignore = [
"D105", # Missing docstring in magic method
"D107", # Missing docstring in __init__
"D212", # Multi-line docstring summary should start at the first line
"D401", # First line should be in imperative mood
"D104", # Missing docstring in public package
"D100", # Missing docstring in public module
"ANN102", # Missing type annotation for self in method
"ANN101", # Missing type annotation for argument
"ANN401", # typing.Any are disallowed in `**kwargs
"PLR0913", # Too many arguments for function call
"D106", # Missing docstring in public nested class
]
exclude = [".venv/"]
mccabe = { max-complexity = 10 }
line-length = 88

[tool.ruff.per-file-ignores]
[tool.ruff.lint.mccabe]
max-complexity = 10

[tool.ruff.lint.per-file-ignores]
"tests/*" = [
"S101", # Use of assert detected
"S301", # Use of pickle detected
Expand All @@ -107,14 +122,14 @@ line-length = 88
"D101", # Missing docstring in public class
]

[tool.ruff.pydocstyle]
[tool.ruff.lint.pydocstyle]
convention = "pep257"
ignore-decorators = ["typing.overload"]

[tool.ruff.pylint]
allow-magic-value-types = ["int", "str", "float", "tuple"]
[tool.ruff.lint.pylint]
allow-magic-value-types = ["int", "str", "float"]

[tool.ruff.flake8-bugbear]
[tool.ruff.lint.flake8-bugbear]
extend-immutable-calls = [
"taskiq_dependencies.Depends",
"taskiq.TaskiqDepends",
Expand Down
2 changes: 1 addition & 1 deletion taskiq_litestar/intializer.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import logging
from typing import Awaitable, Callable
from collections.abc import Awaitable, Callable

from litestar import Litestar
from litestar.datastructures import State
Expand Down
Loading