diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d3711b6..db4b302 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,23 +16,14 @@ jobs: GITHUB_CONTEXT: ${{ toJson(github) }} run: echo "$GITHUB_CONTEXT" - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: 3.13 - cache: "pip" - cache-dependency-path: pyproject.toml - - - uses: actions/cache@v4 - id: cache - with: - path: ${{ env.pythonLocation }} - key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-publish - name: Install build dependencies - if: steps.cache.outputs.cache-hit != 'true' run: pip install build - name: Build distribution @@ -41,7 +32,6 @@ jobs: - name: Publish uses: pypa/gh-action-pypi-publish@release/v1 with: - password: ${{ secrets.PYPI_TOKEN }} skip-existing: true - name: Dump GitHub context diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9570e8e..df36856 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,8 +15,8 @@ jobs: if: github.event.pull_request.draft == false runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - uses: actions/checkout@v5 + - uses: actions/setup-python@v6 with: python-version: 3.13 @@ -24,7 +24,7 @@ jobs: with: version: "latest" - name: Install Dependencies - run: uv pip install --system ".[dev]" + run: uv pip install --system --group dev . - name: Run formatter shell: bash @@ -41,13 +41,13 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] + python-version: ["3.10", "3.11", "3.12", "3.13"] fail-fast: false steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} @@ -55,7 +55,7 @@ jobs: with: version: "latest" - name: Install Dependencies - run: uv pip install --system ".[test]" + run: uv pip install --system --group test . - run: mkdir coverage - name: Test @@ -76,9 +76,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - - uses: actions/setup-python@v5 + - uses: actions/setup-python@v6 with: python-version: 3.13 @@ -87,7 +87,7 @@ jobs: version: "latest" - name: Get coverage files - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v5 with: pattern: .coverage* path: coverage diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2fbd1e0..751ae25 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -31,7 +31,7 @@ python -m pip install --upgrade pip After activating the virtual environment as described above, run: ```bash -pip install -e ".[dev]" +pip install --group dev -e . ``` This will install all the dependencies and your local project in your virtual environment. diff --git a/README.md b/README.md index c3789e9..ecf9bc9 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,8 @@ pip install taskiq-faststream[rabbit] # or pip install taskiq-faststream[kafka] # or +pip install taskiq-faststream[confluent] +# or pip install taskiq-faststream[nats] # or pip install taskiq-faststream[redis] diff --git a/pyproject.toml b/pyproject.toml index a09a813..08aa33a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "taskiq-faststream" -version = "0.2.3" +version = "0.3.0" description = "FastStream - taskiq integration to schedule FastStream tasks" readme = "README.md" authors = [ @@ -10,7 +10,7 @@ authors = [ keywords = ["taskiq", "tasks", "distributed", "async", "FastStream"] -requires-python = ">=3.9" +requires-python = ">=3.10" classifiers = [ "Development Status :: 5 - Production/Stable", @@ -18,11 +18,11 @@ classifiers = [ "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Operating System :: OS Independent", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Software Development :: Libraries", @@ -63,7 +63,7 @@ redis = [ "faststream[redis]" ] -# local dev +[dependency-groups] test = [ "taskiq-faststream[nats]", "taskiq-faststream[rabbit]", @@ -77,31 +77,24 @@ test = [ ] dev = [ - "taskiq-faststream[test]", - "mypy==1.16.0", - "ruff==0.11.12", + {include-group = "test"}, + "mypy==1.18.2", + "ruff==0.13.2", "pre-commit >=3.6.0,<5.0.0", ] +[build-system] +requires = ["uv_build>=0.9.2"] +build-backend = "uv_build" + +[tool.uv.build-backend] +module-root = "" + [project.urls] Homepage = "https://github.com/taskiq-python/taskiq-faststream" Tracker = "https://github.com/taskiq-python/taskiq-faststream/issues" Source = "https://github.com/taskiq-python/taskiq-faststream" -[tool.hatch.metadata] -allow-direct-references = true -allow-ambiguous-features = true - -[tool.hatch.version] -path = "taskiq_faststream/__about__.py" - -[tool.hatch.build] -skip-excluded-dirs = true -exclude = [ - "/tests", - "/.github", -] - [tool.mypy] python_version = "3.9" strict = true diff --git a/taskiq_faststream/utils.py b/taskiq_faststream/utils.py index ba1cb76..e0c5cfd 100644 --- a/taskiq_faststream/utils.py +++ b/taskiq_faststream/utils.py @@ -2,7 +2,11 @@ from fast_depends.utils import is_async_gen_callable, is_gen_callable from faststream.types import SendableMessage -from faststream.utils.functions import to_async + +try: + from faststream.utils.functions import to_async +except ImportError: + from faststream._internal.utils import to_async # type: ignore[no-redef] async def resolve_msg( diff --git a/tests/testcase.py b/tests/testcase.py index 738a9fa..c00852a 100644 --- a/tests/testcase.py +++ b/tests/testcase.py @@ -4,9 +4,9 @@ from typing import Any from unittest.mock import MagicMock +import anyio import pytest from faststream.types import SendableMessage -from faststream.utils.functions import timeout_scope from freezegun import freeze_time from taskiq import AsyncBroker from taskiq.cli.scheduler.args import SchedulerArgs @@ -66,7 +66,7 @@ async def handler(msg: str) -> None: ), ) - with timeout_scope(3.0, True): + with anyio.fail_after(3.0): await event.wait() mock.assert_called_once_with("Hi!")