Skip to content

Commit c58e3e8

Browse files
authored
Merge pull request #22 from danfimov/replace-poetry-with-uv
feat: replace poetry with uv and drop support for python 3.8/3.9
2 parents 1d1703a + 44e8027 commit c58e3e8

19 files changed

+1787
-1015
lines changed

.github/workflows/release.yaml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,20 @@ on:
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
21-
- name: Set version
22-
run: poetry version "${{ github.ref_name }}"
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
2324
- name: Release package
2425
env:
25-
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
26-
run: poetry publish --build
26+
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }}
27+
run: uv publish

.github/workflows/test.yaml

Lines changed: 36 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,67 @@
11
name: Testing taskiq-nats
22

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

513
jobs:
614
lint:
715
strategy:
816
matrix:
9-
cmd:
10-
- black
11-
- ruff
12-
- mypy
17+
cmd: ["black", "ruff", "mypy"]
1318
runs-on: ubuntu-latest
1419
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
20+
- uses: actions/checkout@v5
21+
with:
22+
persist-credentials: false
23+
- id: setup-uv
24+
uses: astral-sh/setup-uv@v7
2025
with:
21-
python-version: "3.11"
22-
cache: "poetry"
26+
enable-cache: true
27+
cache-suffix: 3.11
28+
version: "latest"
29+
python-version: 3.11
2330
- name: Install deps
24-
run: poetry install
31+
run: uv sync --all-extras
2532
- name: Run lint check
26-
run: poetry run pre-commit run -a ${{ matrix.cmd }}
33+
run: uv run pre-commit run -a ${{ matrix.cmd }}
2734
pytest:
2835
strategy:
2936
matrix:
30-
py_version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
37+
py_version: ["3.10", "3.11", "3.12", "3.13"]
3138
runs-on: "ubuntu-latest"
3239
steps:
33-
- uses: actions/checkout@v4
34-
- name: Set up Python
35-
uses: actions/setup-python@v2
40+
- uses: actions/checkout@v5
41+
with:
42+
persist-credentials: false
43+
- id: setup-uv
44+
uses: astral-sh/setup-uv@v7
3645
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
46+
enable-cache: true
47+
cache-suffix: ${{ matrix.py_version }}
48+
version: "latest"
49+
python-version: ${{ matrix.py_version }}
4250
- name: Install deps
43-
run: poetry install
44-
env:
45-
POETRY_VIRTUALENVS_CREATE: false
51+
run: uv sync --all-extras
4652
- name: Update docker-compose
4753
uses: KengoTODA/actions-setup-docker-compose@v1
4854
with:
4955
version: "2.16.0"
5056
- name: docker compose up
5157
run: docker-compose up -d --wait
5258
- name: Run pytest check
53-
run: poetry run pytest -vv -n auto --cov="taskiq_nats" .
59+
run: uv run pytest -vv -n auto --cov="taskiq_nats" .
5460
- name: Generate report
55-
run: poetry run coverage xml
61+
run: uv run coverage xml
5662
- name: Upload coverage reports to Codecov with GitHub Action
57-
uses: codecov/codecov-action@v3
58-
if: matrix.py_version == '3.9'
63+
uses: codecov/codecov-action@v5
64+
if: matrix.py_version == '3.10'
5965
with:
6066
token: ${{ secrets.CODECOV_TOKEN }}
6167
fail_ci_if_error: false

.pre-commit-config.yaml

Lines changed: 48 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,55 @@
11
# See https://pre-commit.com for more information
22
# See https://pre-commit.com/hooks.html for more hooks
33
repos:
4-
- repo: https://github.com/pre-commit/pre-commit-hooks
5-
rev: v2.4.0
6-
hooks:
7-
- id: check-ast
8-
- id: trailing-whitespace
9-
- id: check-toml
10-
- id: end-of-file-fixer
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v6.0.0
6+
hooks:
7+
- id: check-ast
8+
- id: trailing-whitespace
9+
- id: check-toml
10+
- id: end-of-file-fixer
1111

12-
- repo: https://github.com/asottile/add-trailing-comma
13-
rev: v2.1.0
14-
hooks:
15-
- id: add-trailing-comma
12+
- repo: https://github.com/asottile/add-trailing-comma
13+
rev: v4.0.0
14+
hooks:
15+
- id: add-trailing-comma
1616

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

25-
- repo: https://github.com/astral-sh/ruff-pre-commit
26-
rev: v0.6.0
27-
hooks:
28-
- id: ruff
29-
name: ruff-check
30-
pass_filenames: false
31-
args:
32-
- --fix
33-
- taskiq_nats
34-
- tests
22+
- repo: https://github.com/Yelp/detect-secrets
23+
rev: v1.5.0
24+
hooks:
25+
- id: detect-secrets
3526

36-
- repo: https://github.com/pre-commit/mirrors-mypy
37-
rev: v1.11.1
38-
hooks:
39-
- id: mypy
40-
pass_filenames: false
27+
- repo: local
28+
hooks:
29+
- id: black
30+
name: Format with Black
31+
entry: uv run black
32+
language: system
33+
types: [python]
34+
35+
- id: ruff
36+
name: Run ruff lints
37+
entry: uv run ruff
38+
language: system
39+
pass_filenames: false
40+
types: [python]
41+
args:
42+
- "check"
43+
- "--fix"
44+
- "taskiq_nats"
45+
- "tests"
46+
47+
- id: mypy
48+
name: Validate types with MyPy
49+
entry: uv run mypy
50+
language: system
51+
pass_filenames: false
52+
types: [python]
53+
args:
54+
- ./taskiq_nats
55+
- ./tests

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022-2025 Taskiq team
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Taskiq NATS
22

3+
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/taskiq-nats?style=for-the-badge)](https://pypi.org/project/taskiq-nats/)
4+
[![PyPI](https://img.shields.io/pypi/v/taskiq-nats?style=for-the-badge)](https://pypi.org/project/taskiq-nats/)
5+
[![PyPI - Downloads](https://img.shields.io/pypi/dm/taskiq-nats?style=for-the-badge)](https://pypistats.org/packages/taskiq-nats)
6+
37
Taskiq-nats is a plugin for taskiq that adds NATS broker.
48
This package has support for NATS JetStream.
59

@@ -94,7 +98,7 @@ if __name__ == "__main__":
9498
Here's the constructor parameters:
9599

96100
* `servers` - a single string or a list of strings with nats nodes addresses.
97-
* `subject` - name of the subect that will be used to exchange tasks betwee workers and clients.
101+
* `subject` - name of the subect that will be used to exchange tasks between workers and clients.
98102
* `queue` - optional name of the queue. By default NatsBroker broadcasts task to all workers,
99103
but if you want to handle every task only once, you need to supply this argument.
100104
* `result_backend` - custom result backend.
@@ -104,7 +108,7 @@ Here's the constructor parameters:
104108
## JetStreamBroker configuration
105109
### Common
106110
* `servers` - a single string or a list of strings with nats nodes addresses.
107-
* `subject` - name of the subect that will be used to exchange tasks betwee workers and clients.
111+
* `subject` - name of the subect that will be used to exchange tasks between workers and clients.
108112
* `stream_name` - name of the stream where subjects will be located.
109113
* `queue` - a single string or a list of strings with nats nodes addresses.
110114
* `result_backend` - custom result backend.

docker-compose.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: '3.7'
2-
31
# This docker compose is used for testing.
42
# It contains only services required for pytest to run
53
# successfully.

0 commit comments

Comments
 (0)