Skip to content

Commit e7731a5

Browse files
committed
feat: replace poetry with uv
1 parent 0e47fc7 commit e7731a5

File tree

13 files changed

+2174
-2294
lines changed

13 files changed

+2174
-2294
lines changed

.github/workflows/release.yml

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,19 @@ on:
88
jobs:
99
deploy:
1010
runs-on: ubuntu-latest
11+
environment:
12+
name: release
13+
permissions:
14+
id-token: write
1115
steps:
1216
- uses: actions/checkout@v5
1317
with:
1418
persist-credentials: false
15-
- name: Install poetry
16-
run: pipx install poetry
17-
- name: Set up Python
18-
uses: actions/setup-python@v6
19+
- uses: astral-sh/setup-uv@v7
1920
with:
20-
python-version: "3.11"
21-
- name: Install deps
22-
run: poetry install
23-
- name: Set version
24-
run: poetry version "${GITHUB_REF_NAME}"
25-
- name: Release package
26-
env:
27-
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
28-
run: poetry publish --build
21+
enable-cache: false
22+
python-version: "3.12"
23+
version: "latest"
24+
- run: uv version "${GITHUB_REF_NAME}"
25+
- run: uv build
26+
- run: uv publish --trusted-publishing always

.github/workflows/test.yml

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,23 @@ jobs:
1919
lint:
2020
strategy:
2121
matrix:
22-
cmd:
23-
- black
24-
- ruff
25-
- mypy
22+
cmd: ["black", "ruff", "mypy"]
2623
runs-on: ubuntu-latest
2724
steps:
2825
- uses: actions/checkout@v5
2926
with:
3027
persist-credentials: false
31-
- name: Install poetry
32-
run: pipx install poetry
33-
- name: Set up Python
34-
uses: actions/setup-python@v6
28+
- id: setup-uv
29+
uses: astral-sh/setup-uv@v7
3530
with:
36-
python-version: "3.11"
37-
cache: "poetry"
31+
enable-cache: true
32+
cache-suffix: 3.11
33+
version: "latest"
34+
python-version: 3.11
3835
- name: Install deps
39-
run: poetry install --all-extras
36+
run: uv sync --all-extras
4037
- name: Run lint check
41-
run: poetry run pre-commit run -a ${{ matrix.cmd }}
38+
run: uv run pre-commit run -a ${{ matrix.cmd }}
4239
pytest:
4340
strategy:
4441
matrix:
@@ -50,24 +47,24 @@ jobs:
5047
- uses: actions/checkout@v5
5148
with:
5249
persist-credentials: false
53-
- name: Install poetry
54-
run: pipx install poetry
55-
- name: Set up Python
56-
uses: actions/setup-python@v6
50+
- id: setup-uv
51+
uses: astral-sh/setup-uv@v7
5752
with:
58-
python-version: "${{ matrix.py_version }}"
59-
cache: "poetry"
53+
enable-cache: true
54+
cache-suffix: ${{ matrix.python-version }}
55+
version: "latest"
56+
python-version: ${{ matrix.python-version }}
6057
- name: Install deps
61-
run: poetry install --all-extras
58+
run: uv sync --all-extras
6259
- name: Setup pydantic version
63-
run: poetry run pip install "pydantic ${{ matrix.pydantic_ver }}"
60+
run: uv pip install "pydantic ${{ matrix.pydantic_ver }}"
6461
- name: Run pytest check
65-
run: poetry run pytest -vv -n auto --cov="taskiq" .
62+
run: uv run pytest -vv -n auto --cov="taskiq" .
6663
- name: Generate report
67-
run: poetry run coverage xml
64+
run: uv run coverage xml
6865
- name: Upload coverage reports to Codecov with GitHub Action
6966
uses: codecov/codecov-action@v5
70-
if: matrix.os == 'ubuntu-latest' && matrix.py_version == '3.9'
67+
if: matrix.os == 'ubuntu-latest' && matrix.py_version == '3.10'
7168
with:
7269
fail_ci_if_error: false
7370
token: ${{ secrets.CODECOV_TOKEN }}

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ repos:
3333
hooks:
3434
- id: black
3535
name: Format with Black
36-
entry: poetry run black
36+
entry: uv run black
3737
language: system
3838
types: [python]
3939

4040
- id: ruff
4141
name: Run ruff lints
42-
entry: poetry run ruff
42+
entry: uv run ruff
4343
language: system
4444
pass_filenames: false
4545
types: [python]
@@ -51,7 +51,7 @@ repos:
5151

5252
- id: mypy
5353
name: Validate types with MyPy
54-
entry: poetry run mypy
54+
entry: uv run mypy
5555
language: system
5656
pass_filenames: false
5757
types: [python]

docs/contrib.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ We have lots of tests in CI. But since CI runs from first-time contributors shou
1616

1717
## Setting up environment
1818

19-
We use poetry for managing dependencies. To install it, please follow the official guide in [documentation](https://python-poetry.org/docs/).
19+
We use uv for managing dependencies. To install it, please follow the official guide in [documentation](https://docs.astral.sh/uv/getting-started/installation/).
2020

2121
After you have cloned the taskiq repo, install dependencies using this command:
2222

2323
```bash
24-
poetry install
24+
uv sync
2525
```
2626

2727
It will install all required dependencies.

0 commit comments

Comments
 (0)