Skip to content

Commit d303934

Browse files
authored
Merge pull request #111 from vldmrdev/108-remove-depricated-python-versions
Remove support for deprecated Python version and move to uv
2 parents 834b03b + 4668ff2 commit d303934

16 files changed

+1879
-1400
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: 37 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,65 @@
11
name: Testing taskiq-redis
22

33
on:
4-
push:
5-
branches:
6-
- main
7-
- develop
84
pull_request:
5+
paths-ignore:
6+
- '*.md'
7+
push:
8+
paths-ignore:
9+
- '*.md'
10+
11+
permissions:
12+
actions: read
13+
contents: read
14+
pull-requests: read
915

1016
jobs:
1117
lint:
1218
strategy:
1319
matrix:
14-
cmd:
15-
- black
16-
- ruff
17-
- mypy
20+
cmd: [ "black", "ruff", "mypy" ]
1821
runs-on: ubuntu-latest
1922
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
23+
- uses: actions/checkout@v5
24+
with:
25+
persist-credentials: false
26+
- id: setup-uv
27+
uses: astral-sh/setup-uv@v7
2528
with:
26-
python-version: "3.11"
27-
cache: "poetry"
29+
enable-cache: true
30+
cache-suffix: "3.12"
31+
version: "latest"
32+
python-version: "3.12"
2833
- name: Install deps
29-
run: poetry install
34+
run: uv sync --all-extras
3035
- name: Run lint check
31-
run: poetry run pre-commit run -a ${{ matrix.cmd }}
36+
run: uv run pre-commit run -a ${{ matrix.cmd }}
3237
pytest:
3338
strategy:
3439
matrix:
35-
py_version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
40+
py_version: [ "3.10", "3.11", "3.12", "3.13" ]
3641
runs-on: "ubuntu-latest"
3742
steps:
38-
- uses: actions/checkout@v4
43+
- uses: actions/checkout@v5
3944
- name: Set up Redis instance and Redis cluster
4045
run: docker compose up -d
41-
- name: Set up Python
42-
uses: actions/setup-python@v2
46+
- name: Set up uv and enable cache
47+
id: setup-uv
48+
uses: astral-sh/setup-uv@v7
4349
with:
50+
enable-cache: true
51+
cache-suffix: "${{ matrix.py_version }}"
52+
version: "latest"
4453
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
4954
- 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
55+
run: uv sync --all-extras
56+
- name: Run pytest
57+
run: uv run pytest -vv -n auto --cov="taskiq_redis" .
58+
- name: Generate coverage report
59+
run: uv run coverage xml
5760
- name: Upload coverage reports to Codecov with GitHub Action
58-
uses: codecov/codecov-action@v3
59-
if: matrix.py_version == '3.9'
61+
uses: codecov/codecov-action@v5
62+
if: matrix.py_version == '3.10'
6063
with:
6164
token: ${{ secrets.CODECOV_TOKEN }}
6265
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)