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
40 changes: 25 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,34 @@ name: Release python package
on:
push:
tags:
- "*"
- "v*"

jobs:
deploy:
publish:
runs-on: ubuntu-latest

permissions:
contents: read

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
- name: Checkout
uses: actions/checkout@v6
with:
python-version: "3.9"
- name: Install deps
uses: knowsuchagency/poetry-install@v1
env:
POETRY_VIRTUALENVS_CREATE: false
- name: Set verison
run: poetry version "${{ github.ref_name }}"
- name: Release package
persist-credentials: false
fetch-depth: 0

- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "latest"
enable-cache: true
cache-suffix: release-py3.14
Comment thread
s3rius marked this conversation as resolved.
python-version: 3.14

- name: Build package
run: uv build --no-sources

- name: Publish package
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
run: poetry publish --build
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: uv publish
58 changes: 31 additions & 27 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,42 +6,46 @@ jobs:
lint:
strategy:
matrix:
cmd:
- black
- ruff
- mypy
cmd: [ "black", "ruff-check", "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@v6
with:
python-version: "3.11"
cache: "poetry"
persist-credentials: false
fetch-depth: 0
- id: setup-uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
cache-suffix: 3.14
version: "latest"
python-version: 3.14
- name: Install deps
run: poetry install --all-extras
run: uv sync --frozen --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:
strategy:
matrix:
py_version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
runs-on: "ubuntu-latest"
py_version: [ "3.10", "3.11", "3.12", "3.13", "3.14" ]
pydantic_ver: [ "<2", ">=2.5,<3" ]
os: [ ubuntu-latest, windows-latest, macos-latest ]
runs-on: "${{ matrix.os }}"
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
- uses: actions/checkout@v6
with:
persist-credentials: false
fetch-depth: 0
- id: setup-uv
uses: astral-sh/setup-uv@v7
with:
python-version: "${{ matrix.py_version }}"
- name: Update pip
run: python -m pip install -U pip
- name: Install poetry
run: python -m pip install poetry
enable-cache: true
cache-suffix: ${{ matrix.py_version }}
version: "latest"
python-version: ${{ matrix.py_version }}
- name: Install deps
run: poetry install
env:
POETRY_VIRTUALENVS_CREATE: false
run: uv sync --frozen --all-extras
- name: Setup pydantic version
run: uv pip install "pydantic ${{ matrix.pydantic_ver }}"
- name: Run pytest check
run: poetry run pytest -vv -n auto --cov="taskiq_pipelines" .
run: uv run pytest -vv -n auto .
62 changes: 39 additions & 23 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,40 +1,56 @@
# See https://pre-commit.com for more information
# 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-added-large-files
- id: pretty-format-json
args:
- "--indent=2"
- "--autofix"
- id: check-json
- id: check-yaml
exclude: .github/
- id: check-toml
- id: end-of-file-fixer
- id: trailing-whitespace

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

- repo: local
- repo: https://github.com/crate-ci/typos
rev: v1
hooks:
- id: black
name: Format with Black
entry: poetry run black
language: system
types: [python]
- id: typos

- id: ruff
name: Run ruff lints
entry: poetry run ruff
language: system
pass_filenames: false
types: [python]
args:
- "check"
- "--fix"
- "."
- repo: https://github.com/Yelp/detect-secrets
rev: v1.5.0
hooks:
- id: detect-secrets

- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.11.7
hooks:
- id: uv-lock

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.11
hooks:
- id: ruff-format
- id: ruff-check
args: [--fix, --unsafe-fixes]

- repo: local
hooks:
- id: mypy
name: Validate types with MyPy
entry: poetry run mypy
name: mypy
entry: uv run mypy
language: system
types: [python]
always_run: true
pass_filenames: false
args:
- taskiq_pipelines
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ async def main():
.map(add_one) # Here we execute given function for each value.
# [3, 3, 3, 3]
.filter(check) # Here we filter some values.
# But sice our filter filters out all numbers less than zero,
# But since our filter filters out all numbers less than zero,
# our value won't change.
# [3, 3, 3, 3]
)
Expand All @@ -101,7 +101,7 @@ Two notable things here:
2. We can use only tasks as functions we wan to execute in pipeline.
If you want to execute ordinary python function - you must wrap it in task.

Pipeline itself is just a convinient wrapper over list of steps.
Pipeline itself is just a convenient wrapper over list of steps.
Constructed pipeline has the same semantics as the ordinary task, and you can add steps
manually. But all steps of the pipeline must implement `taskiq_pipelines.abc.AbstractStep` class.

Expand Down
Loading
Loading