Skip to content

Commit 40d5bb3

Browse files
committed
feat: replace poetry with uv and drop python 3.8/3.9
1 parent f1c8215 commit 40d5bb3

File tree

15 files changed

+1865
-1844
lines changed

15 files changed

+1865
-1844
lines changed

.flake8

Lines changed: 0 additions & 123 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
name: Release python package
22

33
on:
4-
push:
5-
tags:
6-
- "*"
4+
release:
5+
types:
6+
- released
77

88
jobs:
99
deploy:
1010
runs-on: ubuntu-latest
11+
environment:
12+
name: release
13+
permissions:
14+
id-token: write
1115
steps:
12-
- uses: actions/checkout@v2
13-
- name: Install poetry
14-
run: pipx install poetry
15-
- name: Set up Python
16-
uses: actions/setup-python@v4
16+
- uses: actions/checkout@v5
1717
with:
18-
python-version: "3.11"
19-
- name: Install deps
20-
run: poetry install
21-
- name: Set version
22-
run: poetry version "${{ github.ref_name }}"
23-
- name: Release package
24-
env:
25-
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
26-
run: poetry publish --build
18+
persist-credentials: false
19+
- uses: astral-sh/setup-uv@v7
20+
with:
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: 46 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -2,87 +2,82 @@ name: Testing package
22

33
on:
44
pull_request:
5+
paths-ignore:
6+
- '*.md'
57
push:
8+
paths-ignore:
9+
- '*.md'
10+
11+
permissions:
12+
actions: read
13+
contents: read
14+
pull-requests: read
615

716
jobs:
817
lint:
918
strategy:
1019
matrix:
11-
cmd:
12-
- black
13-
- flake8
14-
- isort
15-
- mypy
16-
- autoflake
20+
cmd: ["black", "ruff", "mypy"]
1721
runs-on: ubuntu-latest
1822
steps:
19-
- uses: actions/checkout@v2
20-
- name: Install poetry
21-
run: pipx install poetry
22-
- name: Set up Python
23-
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
2428
with:
25-
python-version: "3.9"
26-
cache: "poetry"
29+
enable-cache: true
30+
cache-suffix: 3.11
31+
version: "latest"
32+
python-version: 3.11
2733
- name: Install deps
28-
run: poetry install
34+
run: uv sync --all-extras
2935
- name: Run lint check
30-
run: poetry run pre-commit run -a ${{ matrix.cmd }}
36+
run: uv run pre-commit run -a ${{ matrix.cmd }}
3137
pytest:
3238
services:
33-
zookeeper:
34-
image: bitnami/zookeeper:3.8.1
35-
ports:
36-
- 2181:2181
37-
env:
38-
ALLOW_ANONYMOUS_LOGIN: yes
39-
options: >-
40-
--health-cmd "echo mntr | nc -w 2 -q 2 localhost 2181"
41-
--health-interval 10s
42-
--health-timeout 5s
43-
--health-retries 5
4439
kafka:
45-
image: bitnami/kafka:3.4.1
40+
image: apache/kafka:4.1.1
4641
ports:
4742
- 9092:9092
4843
options: >-
49-
--health-cmd "kafka-broker-api-versions.sh --version"
44+
--health-cmd "nc -z localhost 9092"
5045
--health-interval 10s
5146
--health-timeout 5s
52-
--health-retries 5
47+
--health-retries 8
5348
env:
54-
KAFKA_CFG_ZOOKEEPER_CONNECT: zookeeper:2181
55-
ALLOW_PLAINTEXT_LISTENER: yes
56-
KAFKA_CFG_LISTENERS: PLAINTEXT://:9092
57-
KAFKA_CFG_ADVERTISED_LISTENERS: PLAINTEXT://127.0.0.1:9092
58-
KAFKA_ENABLE_KRAFT: "no"
59-
permissions:
60-
checks: write
61-
pull-requests: write
62-
contents: write
49+
KAFKA_NODE_ID: 1
50+
KAFKA_PROCESS_ROLES: broker,controller
51+
KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:9092,CONTROLLER://localhost:9093
52+
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092
53+
KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER
54+
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT
55+
KAFKA_CONTROLLER_QUORUM_VOTERS: 1@localhost:9093
6356
strategy:
6457
matrix:
65-
py_version: ["3.9", "3.10", "3.11"]
58+
py_version: ["3.10", "3.11", "3.12", "3.13"]
6659
os: [ubuntu-latest]
6760
runs-on: "${{ matrix.os }}"
6861
steps:
69-
- uses: actions/checkout@v2
70-
- name: Install poetry
71-
run: pipx install poetry
72-
- name: Set up Python
73-
uses: actions/setup-python@v4
62+
- uses: actions/checkout@v5
63+
with:
64+
persist-credentials: false
65+
- id: setup-uv
66+
uses: astral-sh/setup-uv@v7
7467
with:
75-
python-version: "${{ matrix.py_version }}"
76-
cache: "poetry"
68+
enable-cache: true
69+
cache-suffix: ${{ matrix.py_version }}
70+
version: "latest"
71+
python-version: ${{ matrix.py_version }}
7772
- name: Install deps
78-
run: poetry install
73+
run: uv sync --all-extras
7974
- name: Run pytest check
80-
run: poetry run pytest -vv -n auto --cov="taskiq_aio_kafka" .
75+
run: uv run pytest -vv -n auto --cov="taskiq_aio_kafka" .
8176
- name: Generate report
82-
run: poetry run coverage xml
77+
run: uv run coverage xml
8378
- name: Upload coverage reports to Codecov with GitHub Action
84-
uses: codecov/codecov-action@v3
85-
if: matrix.os == 'ubuntu-latest' && matrix.py_version == '3.9'
79+
uses: codecov/codecov-action@v5
80+
if: matrix.os == 'ubuntu-latest' && matrix.py_version == '3.10'
8681
with:
8782
token: ${{ secrets.CODECOV_TOKEN }}
8883
fail_ci_if_error: false

.pre-commit-config.yaml

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,57 +2,57 @@
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

17+
- repo: https://github.com/crate-ci/typos
18+
rev: v1.38.1
19+
hooks:
20+
- id: typos
21+
22+
- repo: https://github.com/Yelp/detect-secrets
23+
rev: v1.5.0
24+
hooks:
25+
- id: detect-secrets
26+
args: [
27+
'--exclude-lines', 'amqp://guest:guest@localhost:5672',
28+
]
29+
1730
- repo: local
1831
hooks:
1932
- id: black
2033
name: Format with Black
21-
entry: poetry run black
22-
language: system
23-
types: [python]
24-
25-
- id: autoflake
26-
name: autoflake
27-
entry: poetry run autoflake
34+
entry: uv run black
2835
language: system
2936
types: [python]
30-
args: [--in-place, --remove-all-unused-imports, --remove-duplicate-keys]
3137

32-
- id: isort
33-
name: isort
34-
entry: poetry run isort
35-
language: system
36-
types: [python]
37-
38-
- id: flake8
39-
name: Check with Flake8
40-
entry: poetry run flake8
38+
- id: ruff
39+
name: Run ruff lints
40+
entry: uv run ruff
4141
language: system
4242
pass_filenames: false
4343
types: [python]
44-
args: [--count, taskiq_aio_kafka]
44+
args:
45+
- "check"
46+
- "--fix"
47+
- "taskiq_aio_kafka"
48+
- "tests"
4549

4650
- id: mypy
4751
name: Validate types with MyPy
48-
entry: poetry run mypy
52+
entry: uv run mypy
4953
language: system
50-
types: [python]
51-
args: [taskiq_aio_kafka]
5254
pass_filenames: false
53-
54-
- id: yesqa
55-
name: Remove usless noqa
56-
entry: poetry run yesqa
57-
language: system
5855
types: [python]
56+
args:
57+
- ./taskiq_aio_kafka
58+
- ./tests

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2022-2023 Taskiq team
3+
Copyright (c) 2022-2025 Taskiq team
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)