Skip to content

Commit 5e5f58b

Browse files
committed
fix: release python-version for uv
fix: lint steps fix: uv build version update: Release workflow update: test workflow update: dependencies fix: lint fix: action update: git action del: poetry add: uv update: pre-commit hooks
1 parent ef097a5 commit 5e5f58b

File tree

9 files changed

+1809
-1186
lines changed

9 files changed

+1809
-1186
lines changed

.github/workflows/release.yml

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,38 @@ name: Release python package
33
on:
44
push:
55
tags:
6-
- "*"
6+
- "v*"
77

88
jobs:
9-
deploy:
9+
publish:
1010
runs-on: ubuntu-latest
11+
12+
permissions:
13+
contents: read
14+
1115
steps:
12-
- uses: actions/checkout@v2
13-
- name: Set up Python
14-
uses: actions/setup-python@v2
16+
- name: Checkout
17+
uses: actions/checkout@v5
1518
with:
16-
python-version: "3.9"
17-
- name: Install deps
18-
uses: knowsuchagency/poetry-install@v1
19-
env:
20-
POETRY_VIRTUALENVS_CREATE: false
21-
- name: Set verison
22-
run: poetry version "${{ github.ref_name }}"
23-
- name: Release package
19+
persist-credentials: false
20+
21+
- name: Install uv
22+
uses: astral-sh/setup-uv@v7
23+
with:
24+
version: "latest"
25+
enable-cache: true
26+
cache-suffix: release-py3.14
27+
python-version: 3.14
28+
- name: Set version from tag
29+
shell: bash
30+
run: |
31+
VERSION="${GITHUB_REF_NAME#v}"
32+
uv version "$VERSION" --frozen
33+
34+
- name: Build package
35+
run: uv build --no-sources
36+
37+
- name: Publish package
2438
env:
25-
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
26-
run: poetry publish --build
39+
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }}
40+
run: uv publish

.github/workflows/test.yml

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,42 +6,44 @@ jobs:
66
lint:
77
strategy:
88
matrix:
9-
cmd:
10-
- black
11-
- ruff
12-
- mypy
9+
cmd: [ "black", "ruff-check", "mypy" ]
1310
runs-on: ubuntu-latest
1411
steps:
15-
- uses: actions/checkout@v2
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
2013
with:
21-
python-version: "3.11"
22-
cache: "poetry"
14+
persist-credentials: false
15+
- id: setup-uv
16+
uses: astral-sh/setup-uv@v7
17+
with:
18+
enable-cache: true
19+
cache-suffix: 3.14
20+
version: "latest"
21+
python-version: 3.14
2322
- name: Install deps
24-
run: poetry install --all-extras
23+
run: uv sync --frozen --all-extras
2524
- name: Run lint check
26-
run: poetry run pre-commit run -a ${{ matrix.cmd }}
25+
run: uv run pre-commit run -a ${{ matrix.cmd }}
2726
pytest:
2827
strategy:
2928
matrix:
30-
py_version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
31-
runs-on: "ubuntu-latest"
29+
py_version: [ "3.10", "3.11", "3.12", "3.13", "3.14" ]
30+
pydantic_ver: [ "<2", ">=2.5,<3" ]
31+
os: [ ubuntu-latest, windows-latest, macos-latest ]
32+
runs-on: "${{ matrix.os }}"
3233
steps:
33-
- uses: actions/checkout@v2
34-
- name: Set up Python
35-
uses: actions/setup-python@v2
34+
- uses: actions/checkout@v5
35+
with:
36+
persist-credentials: false
37+
- id: setup-uv
38+
uses: astral-sh/setup-uv@v7
3639
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
40+
enable-cache: true
41+
cache-suffix: ${{ matrix.py_version }}
42+
version: "latest"
43+
python-version: ${{ matrix.py_version }}
4244
- name: Install deps
43-
run: poetry install
44-
env:
45-
POETRY_VIRTUALENVS_CREATE: false
45+
run: uv sync --frozen --all-extras
46+
- name: Setup pydantic version
47+
run: uv pip install "pydantic ${{ matrix.pydantic_ver }}"
4648
- name: Run pytest check
47-
run: poetry run pytest -vv -n auto --cov="taskiq_pipelines" .
49+
run: uv run pytest -vv -n auto .

.pre-commit-config.yaml

Lines changed: 42 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,60 @@
11
# See https://pre-commit.com for more information
22
# See https://pre-commit.com/hooks.html for more hooks
3+
34
repos:
45
- repo: https://github.com/pre-commit/pre-commit-hooks
5-
rev: v2.4.0
6+
rev: v6.0.0
67
hooks:
7-
- id: check-ast
8-
- id: trailing-whitespace
8+
- id: check-added-large-files
9+
- id: pretty-format-json
10+
args:
11+
- "--indent=2"
12+
- "--autofix"
13+
- id: check-json
14+
- id: check-yaml
15+
exclude: .github/
916
- id: check-toml
1017
- id: end-of-file-fixer
18+
- id: trailing-whitespace
1119

1220
- repo: https://github.com/asottile/add-trailing-comma
13-
rev: v2.1.0
21+
rev: v4.0.0
1422
hooks:
1523
- id: add-trailing-comma
1624

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

25-
- id: ruff
26-
name: Run ruff lints
27-
entry: poetry run ruff
28-
language: system
29-
pass_filenames: false
30-
types: [python]
31-
args:
32-
- "check"
33-
- "--fix"
34-
- "."
30+
- repo: https://github.com/Yelp/detect-secrets
31+
rev: v1.5.0
32+
hooks:
33+
- id: detect-secrets
34+
35+
- repo: https://github.com/astral-sh/uv-pre-commit
36+
rev: 0.11.2
37+
hooks:
38+
- id: uv-lock
3539

40+
- repo: https://github.com/astral-sh/ruff-pre-commit
41+
rev: v0.15.8
42+
hooks:
43+
- id: ruff-format
44+
- id: ruff-check
45+
args: [ --fix, --unsafe-fixes ]
46+
47+
- repo: https://github.com/pre-commit/mirrors-mypy
48+
rev: 'v1.19.1'
49+
hooks:
3650
- id: mypy
37-
name: Validate types with MyPy
38-
entry: poetry run mypy
51+
additional_dependencies: [ "no_implicit_optional" ]
52+
args: [ "--config-file=pyproject.toml", "--install-types", "--non-interactive" ]
53+
54+
- repo: local
55+
hooks:
56+
- id: black
57+
name: Format with Black
58+
entry: uv run black
3959
language: system
4060
types: [python]

0 commit comments

Comments
 (0)