Skip to content

Commit ed0fb08

Browse files
committed
refactor: remove deprecatedpPython version and move to uv
1 parent f7c061f commit ed0fb08

File tree

12 files changed

+1838
-1388
lines changed

12 files changed

+1838
-1388
lines changed

.github/workflows/release.yml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,25 @@ name: Release python package
33
on:
44
push:
55
tags:
6-
- "*"
6+
- released
77

88
jobs:
99
deploy:
1010
runs-on: ubuntu-latest
11+
permissions:
12+
id-token: write
1113
steps:
12-
- uses: actions/checkout@v2
13-
- name: Set up Python
14-
uses: actions/setup-python@v2
14+
- uses: actions/checkout@v5
1515
with:
16-
python-version: "3.11"
17-
- name: Install deps
18-
uses: knowsuchagency/poetry-install@v1
19-
env:
20-
POETRY_VIRTUALENVS_CREATE: false
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.yml

Lines changed: 27 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -11,52 +11,49 @@ jobs:
1111
lint:
1212
strategy:
1313
matrix:
14-
cmd:
15-
- black
16-
- ruff
17-
- mypy
14+
cmd: [ "black", "ruff", "mypy" ]
1815
runs-on: ubuntu-latest
1916
steps:
20-
- uses: actions/checkout@v4
21-
- name: Install poetry
22-
run: pipx install poetry
23-
- name: Set up Python
24-
uses: actions/setup-python@v4
17+
- uses: actions/checkout@v5
2518
with:
26-
python-version: "3.11"
27-
cache: "poetry"
19+
persist-credentials: false
20+
- id: setup-uv
21+
uses: astral-sh/setup-uv@v7
22+
with:
23+
enable-cache: true
24+
cache-suffix: "3.12"
25+
version: "latest"
26+
python-version: "3.12"
2827
- name: Install deps
29-
run: poetry install
28+
run: uv sync --all-extras
3029
- name: Run lint check
31-
run: poetry run pre-commit run -a ${{ matrix.cmd }}
30+
run: uv run pre-commit run -a ${{ matrix.cmd }}
3231
pytest:
3332
strategy:
3433
matrix:
35-
py_version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
34+
py_version: [ "3.10", "3.11", "3.12", "3.13" ]
3635
runs-on: "ubuntu-latest"
3736
steps:
38-
- uses: actions/checkout@v4
37+
- uses: actions/checkout@v5
3938
- name: Set up Redis instance and Redis cluster
4039
run: docker compose up -d
41-
- name: Set up Python
42-
uses: actions/setup-python@v2
40+
- name: Set up uv and enable cache
41+
id: setup-uv
42+
uses: astral-sh/setup-uv@v7
4343
with:
44+
enable-cache: true
45+
cache-suffix: "${{ matrix.py_version }}"
46+
version: "latest"
4447
python-version: "${{ matrix.py_version }}"
45-
- name: Update pip
46-
run: python -m pip install -U pip
47-
- name: Install poetry
48-
run: python -m pip install poetry
4948
- name: Install deps
50-
run: poetry install
51-
env:
52-
POETRY_VIRTUALENVS_CREATE: false
53-
- name: Run pytest check
54-
run: poetry run pytest -vv -n auto --cov="taskiq_redis" .
55-
- name: Generate report
56-
run: poetry run coverage xml
49+
run: uv sync --all-extras
50+
- name: Run pytest
51+
run: uv run pytest -vv -n auto --cov="taskiq_redis" .
52+
- name: Generate coverage report
53+
run: uv run coverage xml
5754
- name: Upload coverage reports to Codecov with GitHub Action
58-
uses: codecov/codecov-action@v3
59-
if: matrix.py_version == '3.9'
55+
uses: codecov/codecov-action@v5
56+
if: matrix.py_version == '3.10'
6057
with:
6158
token: ${{ secrets.CODECOV_TOKEN }}
6259
fail_ci_if_error: false

.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,29 @@
22
# See https://pre-commit.com/hooks.html for more hooks
33
repos:
44
- repo: https://github.com/pre-commit/pre-commit-hooks
5-
rev: v2.4.0
5+
rev: v6.0.0
66
hooks:
77
- id: check-ast
88
- id: trailing-whitespace
99
- id: check-toml
1010
- id: end-of-file-fixer
1111

1212
- repo: https://github.com/asottile/add-trailing-comma
13-
rev: v2.1.0
13+
rev: v4.0.0
1414
hooks:
1515
- id: add-trailing-comma
1616

1717
- repo: local
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: ruff
2626
name: Run ruff lints
27-
entry: poetry run ruff
27+
entry: uv run ruff
2828
language: system
2929
pass_filenames: false
3030
types: [python]
@@ -36,6 +36,6 @@ repos:
3636

3737
- id: mypy
3838
name: Validate types with MyPy
39-
entry: poetry run mypy
39+
entry: uv run mypy
4040
language: system
4141
types: [ python ]

0 commit comments

Comments
 (0)