Skip to content

Commit 5557827

Browse files
committed
refactor: remove deprecated python version and move to uv
1 parent def350f commit 5557827

File tree

9 files changed

+1845
-1825
lines changed

9 files changed

+1845
-1825
lines changed

.github/workflows/release.yaml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +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.9"
17-
- name: Install deps
18-
uses: knowsuchagency/poetry-install@v1
19-
env:
20-
POETRY_VIRTUALENVS_CREATE: false
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.yaml

Lines changed: 26 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,57 +6,52 @@ jobs:
66
lint:
77
strategy:
88
matrix:
9-
cmd:
10-
- black
11-
- ruff
12-
- mypy
9+
cmd: [ "black", "ruff", "mypy" ]
1310
runs-on: ubuntu-latest
1411
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
12+
- uses: actions/checkout@v5
13+
- id: setup-uv
14+
uses: astral-sh/setup-uv@v7
2015
with:
21-
python-version: "3.11"
22-
cache: "poetry"
16+
enable-cache: true
17+
cache-suffix: "3.12"
18+
version: "latest"
19+
python-version: "3.12"
2320
- name: Install deps
24-
run: poetry install
21+
run: uv sync --all-extras
2522
- name: Run lint check
26-
run: poetry run pre-commit run -a ${{ matrix.cmd }}
23+
run: uv run pre-commit run -a ${{ matrix.cmd }}
2724
pytest:
2825
strategy:
2926
matrix:
30-
py_version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
27+
py_version: [ "3.10", "3.11", "3.12", "3.13" ]
3128
runs-on: "ubuntu-latest"
3229
steps:
33-
- uses: actions/checkout@v4
30+
- uses: actions/checkout@v5
3431
- name: Set up PostgreSQL
35-
uses: ikalnytskyi/action-setup-postgres@v4
32+
uses: ikalnytskyi/action-setup-postgres@v8
3633
with:
3734
username: postgres
3835
password: postgres
3936
database: taskiqpsqlpy
4037
id: postgres
41-
- name: Set up Python
42-
uses: actions/setup-python@v2
38+
- name: Set up uv and enable cache
39+
id: setup-uv
40+
uses: astral-sh/setup-uv@v7
4341
with:
42+
enable-cache: true
43+
cache-suffix: "${{ matrix.py_version }}"
44+
version: "latest"
4445
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
4946
- 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_psqlpy" .
55-
- name: Generate report
56-
run: poetry run coverage xml
47+
run: uv sync --all-extras
48+
- name: Run pytest
49+
run: uv run pytest -vv -n auto --cov="taskiq_psqlpy" .
50+
- name: Generate coverage report
51+
run: uv run coverage xml
5752
- name: Upload coverage reports to Codecov with GitHub Action
58-
uses: codecov/codecov-action@v3
59-
if: matrix.py_version == '3.9'
53+
uses: codecov/codecov-action@v5
54+
if: matrix.py_version == '3.10'
6055
with:
6156
token: ${{ secrets.CODECOV_TOKEN }}
6257
fail_ci_if_error: false

.pre-commit-config.yaml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,40 @@
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:
15-
- id: add-trailing-comma
15+
- id: add-trailing-comma
1616

1717
- repo: local
1818
hooks:
19+
- id: black
20+
name: Format with Black
21+
entry: uv run black
22+
language: system
23+
types: [python]
24+
1925
- id: ruff
2026
name: Run ruff lints
21-
entry: poetry run ruff check
27+
entry: uv run ruff
2228
language: system
2329
pass_filenames: false
24-
types: [ python ]
30+
types: [python]
2531
args:
32+
- check
2633
- "--fix"
2734
- "taskiq_psqlpy"
2835
- "tests"
2936

30-
- id: black
31-
name: Format with Black
32-
entry: poetry run black
33-
language: system
34-
types: [ python ]
35-
3637
- id: mypy
3738
name: Validate types with MyPy
38-
entry: poetry run mypy
39+
entry: uv run mypy
3940
language: system
4041
types: [ python ]

README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@ This project can be installed using pip:
1313
pip install taskiq-psqlpy
1414
```
1515

16-
Or using poetry:
17-
```
18-
poetry add taskiq-psqlpy
19-
```
20-
2116
## Usage
2217
Let's see the example with the redis broker and PostgreSQL PSQLPy result backend:
2318
```python

0 commit comments

Comments
 (0)