Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
123 changes: 0 additions & 123 deletions .flake8

This file was deleted.

34 changes: 17 additions & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
name: Release python package

on:
push:
tags:
- "*"
release:
types:
- released

jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: release
permissions:
id-token: write
steps:
- uses: actions/checkout@v2
- name: Install poetry
run: pipx install poetry
- name: Set up Python
uses: actions/setup-python@v4
- uses: actions/checkout@v5
with:
python-version: "3.11"
- name: Install deps
run: poetry install
- name: Set version
run: poetry version "${{ github.ref_name }}"
- name: Release package
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
run: poetry publish --build
persist-credentials: false
- uses: astral-sh/setup-uv@v7
with:
enable-cache: false
python-version: "3.12"
version: "latest"
- run: uv version "${GITHUB_REF_NAME}"
- run: uv build
- run: uv publish --trusted-publishing always
97 changes: 46 additions & 51 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,87 +2,82 @@ name: Testing package

on:
pull_request:
paths-ignore:
- '*.md'
push:
paths-ignore:
- '*.md'

permissions:
actions: read
contents: read
pull-requests: read

jobs:
lint:
strategy:
matrix:
cmd:
- black
- flake8
- isort
- mypy
- autoflake
cmd: ["black", "ruff", "mypy"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install poetry
run: pipx install poetry
- name: Set up Python
uses: actions/setup-python@v4
- uses: actions/checkout@v5
with:
persist-credentials: false
- id: setup-uv
uses: astral-sh/setup-uv@v7
with:
python-version: "3.9"
cache: "poetry"
enable-cache: true
cache-suffix: 3.11
version: "latest"
python-version: 3.11
- name: Install deps
run: poetry install
run: uv sync --all-extras
- name: Run lint check
run: poetry run pre-commit run -a ${{ matrix.cmd }}
run: uv run pre-commit run -a ${{ matrix.cmd }}
pytest:
services:
zookeeper:
image: bitnami/zookeeper:3.8.1
ports:
- 2181:2181
env:
ALLOW_ANONYMOUS_LOGIN: yes
options: >-
--health-cmd "echo mntr | nc -w 2 -q 2 localhost 2181"
--health-interval 10s
--health-timeout 5s
--health-retries 5
kafka:
image: bitnami/kafka:3.4.1
image: apache/kafka:4.1.1
ports:
- 9092:9092
options: >-
--health-cmd "kafka-broker-api-versions.sh --version"
--health-cmd "nc -z localhost 9092"
--health-interval 10s
--health-timeout 5s
--health-retries 5
--health-retries 8
env:
KAFKA_CFG_ZOOKEEPER_CONNECT: zookeeper:2181
ALLOW_PLAINTEXT_LISTENER: yes
KAFKA_CFG_LISTENERS: PLAINTEXT://:9092
KAFKA_CFG_ADVERTISED_LISTENERS: PLAINTEXT://127.0.0.1:9092
KAFKA_ENABLE_KRAFT: "no"
permissions:
checks: write
pull-requests: write
contents: write
KAFKA_NODE_ID: 1
KAFKA_PROCESS_ROLES: broker,controller
KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:9092,CONTROLLER://localhost:9093
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092
KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT
KAFKA_CONTROLLER_QUORUM_VOTERS: 1@localhost:9093
strategy:
matrix:
py_version: ["3.9", "3.10", "3.11"]
py_version: ["3.10", "3.11", "3.12", "3.13"]
os: [ubuntu-latest]
runs-on: "${{ matrix.os }}"
steps:
- uses: actions/checkout@v2
- name: Install poetry
run: pipx install poetry
- name: Set up Python
uses: actions/setup-python@v4
- uses: actions/checkout@v5
with:
persist-credentials: false
- id: setup-uv
uses: astral-sh/setup-uv@v7
with:
python-version: "${{ matrix.py_version }}"
cache: "poetry"
enable-cache: true
cache-suffix: ${{ matrix.py_version }}
version: "latest"
python-version: ${{ matrix.py_version }}
- name: Install deps
run: poetry install
run: uv sync --all-extras
- name: Run pytest check
run: poetry run pytest -vv -n auto --cov="taskiq_aio_kafka" .
run: uv run pytest -vv -n auto --cov="taskiq_aio_kafka" .
- name: Generate report
run: poetry run coverage xml
run: uv run coverage xml
- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v3
if: matrix.os == 'ubuntu-latest' && matrix.py_version == '3.9'
uses: codecov/codecov-action@v5
if: matrix.os == 'ubuntu-latest' && matrix.py_version == '3.10'
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
Expand Down
56 changes: 28 additions & 28 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,57 +2,57 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.4.0
rev: v6.0.0
hooks:
- id: check-ast
- id: trailing-whitespace
- id: check-toml
- id: end-of-file-fixer

- repo: https://github.com/asottile/add-trailing-comma
rev: v2.1.0
rev: v4.0.0
hooks:
- id: add-trailing-comma

- repo: https://github.com/crate-ci/typos
rev: v1.38.1
hooks:
- id: typos

- repo: https://github.com/Yelp/detect-secrets
rev: v1.5.0
hooks:
- id: detect-secrets
args: [
'--exclude-lines', 'amqp://guest:guest@localhost:5672',
]

- repo: local
hooks:
- id: black
name: Format with Black
entry: poetry run black
language: system
types: [python]

- id: autoflake
name: autoflake
entry: poetry run autoflake
entry: uv run black
language: system
types: [python]
args: [--in-place, --remove-all-unused-imports, --remove-duplicate-keys]

- id: isort
name: isort
entry: poetry run isort
language: system
types: [python]

- id: flake8
name: Check with Flake8
entry: poetry run flake8
- id: ruff
name: Run ruff lints
entry: uv run ruff
language: system
pass_filenames: false
types: [python]
args: [--count, taskiq_aio_kafka]
args:
- "check"
- "--fix"
- "taskiq_aio_kafka"
- "tests"

- id: mypy
name: Validate types with MyPy
entry: poetry run mypy
entry: uv run mypy
language: system
types: [python]
args: [taskiq_aio_kafka]
pass_filenames: false

- id: yesqa
name: Remove usless noqa
entry: poetry run yesqa
language: system
types: [python]
args:
- ./taskiq_aio_kafka
- ./tests
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022-2023 Taskiq team
Copyright (c) 2022-2025 Taskiq team

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