From b0d6c151faf0d37e13640e4f22e6b084b05c047f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Jun 2024 18:47:59 +0000 Subject: [PATCH 01/11] chore(deps): bump pypa/gh-action-pypi-publish from 1.8.14 to 1.9.0 Bumps [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) from 1.8.14 to 1.9.0. - [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases) - [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/v1.8.14...v1.9.0) --- updated-dependencies: - dependency-name: pypa/gh-action-pypi-publish dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8b8429b..5dfd5d4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -39,7 +39,7 @@ jobs: run: python -m build - name: Publish - uses: pypa/gh-action-pypi-publish@v1.8.14 + uses: pypa/gh-action-pypi-publish@v1.9.0 with: password: ${{ secrets.PYPI_TOKEN }} From 1ec9adb1dd49438108962a4d063d0ddfe4faefef Mon Sep 17 00:00:00 2001 From: sheldy Date: Sat, 26 Oct 2024 19:11:26 +0200 Subject: [PATCH 02/11] Add py.typed marker --- taskiq_faststream/py.typed | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 taskiq_faststream/py.typed diff --git a/taskiq_faststream/py.typed b/taskiq_faststream/py.typed new file mode 100644 index 0000000..e69de29 From 3b1495bfe6745f9013a6526dbf0cbc6696e508ad Mon Sep 17 00:00:00 2001 From: Nikita Pastukhov Date: Sat, 3 May 2025 17:36:20 +0300 Subject: [PATCH 03/11] chore: drop python3.8 support --- .github/dependabot.yml | 8 ++++++++ .github/workflows/test.yml | 2 +- .gitignore | 4 ++++ pyproject.toml | 22 +++++++++++----------- scripts/lint.sh | 2 +- taskiq_faststream/__about__.py | 2 +- taskiq_faststream/__init__.py | 2 +- taskiq_faststream/broker.py | 7 +++---- taskiq_faststream/formatter.py | 4 ++-- tests/test_resolve_message.py | 2 +- tests/testcase.py | 4 ++-- 11 files changed, 35 insertions(+), 24 deletions(-) mode change 100644 => 100755 scripts/lint.sh diff --git a/.github/dependabot.yml b/.github/dependabot.yml index a72abdc..9483cee 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -10,8 +10,16 @@ updates: directory: "/" schedule: interval: "weekly" + groups: + github-actions: + patterns: + - "*" # Python - package-ecosystem: "pip" # See documentation for possible values directory: "/" # Location of package manifests schedule: interval: "weekly" + groups: + pip: + patterns: + - "*" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1408c44..845cb57 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -40,7 +40,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.9", "3.10", "3.11", "3.12, "3.13"] fail-fast: false steps: diff --git a/.gitignore b/.gitignore index 44bbb13..1a0ef5b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +uv.lock + # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] @@ -143,6 +145,8 @@ venv.bak/ .dmypy.json dmypy.json +.ruff_cache/ + # Pyre type checker .pyre/ diff --git a/pyproject.toml b/pyproject.toml index 50c24b4..cd427f2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,7 @@ authors = [ keywords = ["taskiq", "tasks", "distributed", "async", "FastStream"] -requires-python = ">=3.8" +requires-python = ">=3.9" classifiers = [ "Development Status :: 5 - Production/Stable", @@ -21,11 +21,11 @@ classifiers = [ "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.8", "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", "Operating System :: OS Independent", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Software Development :: Libraries", @@ -107,7 +107,7 @@ exclude = [ ] [tool.mypy] -python_version = "3.8" +python_version = "3.9" strict = true ignore_missing_imports = true allow_subclassing_any = true @@ -125,12 +125,14 @@ known_third_party = ["faststream", "taskiq"] [tool.ruff] fix = true -target-version = "py38" +target-version = "py39" line-length = 88 -mccabe = { max-complexity = 10 } +[tool.ruff.lint] # List of enabled rulsets. # See https://docs.astral.sh/ruff/rules/ for more information. +mccabe = { max-complexity = 10 } + select = [ "E", # Error "F", # Pyflakes @@ -167,8 +169,6 @@ ignore = [ "D401", # First line should be in imperative mood "D104", # Missing docstring in public package "D100", # Missing docstring in public module - "ANN102", # Missing type annotation for self in method - "ANN101", # Missing type annotation for argument "ANN401", # typing.Any are disallowed in `**kwargs "PLR0913", # Too many arguments for function call "D106", # Missing docstring in public nested class @@ -177,7 +177,7 @@ ignore = [ ] exclude = [".venv/"] -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] "tests/*" = [ "S101", # Use of assert detected "S301", # Use of pickle detected @@ -187,14 +187,14 @@ exclude = [".venv/"] "D101", # Missing docstring in public class ] -[tool.ruff.pydocstyle] +[tool.ruff.lint.pydocstyle] convention = "google" ignore-decorators = ["typing.overload"] -[tool.ruff.pylint] +[tool.ruff.lint.pylint] allow-magic-value-types = ["int", "str", "float"] -[tool.ruff.flake8-bugbear] +[tool.ruff.lint.flake8-bugbear] extend-immutable-calls = [] [tool.pytest.ini_options] diff --git a/scripts/lint.sh b/scripts/lint.sh old mode 100644 new mode 100755 index 9203bc1..ba0c426 --- a/scripts/lint.sh +++ b/scripts/lint.sh @@ -1,7 +1,7 @@ #!/bin/bash echo "Running ruff..." -ruff taskiq_faststream tests --fix +ruff check taskiq_faststream tests --fix echo "Running ruff formatter..." ruff format taskiq_faststream tests diff --git a/taskiq_faststream/__about__.py b/taskiq_faststream/__about__.py index d9e60ec..db42d9c 100644 --- a/taskiq_faststream/__about__.py +++ b/taskiq_faststream/__about__.py @@ -1,3 +1,3 @@ """FastStream - taskiq integration to schedule FastStream tasks.""" -__version__ = "0.2.0" +__version__ = "0.2.1" diff --git a/taskiq_faststream/__init__.py b/taskiq_faststream/__init__.py index a95051d..045390d 100644 --- a/taskiq_faststream/__init__.py +++ b/taskiq_faststream/__init__.py @@ -2,7 +2,7 @@ from taskiq_faststream.scheduler import StreamScheduler __all__ = ( + "AppWrapper", "BrokerWrapper", "StreamScheduler", - "AppWrapper", ) diff --git a/taskiq_faststream/broker.py b/taskiq_faststream/broker.py index 35abc1e..4b5fe9a 100644 --- a/taskiq_faststream/broker.py +++ b/taskiq_faststream/broker.py @@ -8,7 +8,7 @@ from taskiq import AsyncBroker from taskiq.acks import AckableMessage from taskiq.decor import AsyncTaskiqDecoratedTask -from typing_extensions import TypeAlias, override +from typing_extensions import TypeAlias from taskiq_faststream.formatter import PatchedFormatter, PathcedMessage from taskiq_faststream.types import ScheduledTask @@ -66,8 +66,7 @@ async def listen( yield b"" await anyio.sleep(60) - @override - def task( # type: ignore[override] + def task( self, message: typing.Union[ None, @@ -76,7 +75,7 @@ def task( # type: ignore[override] typing.Callable[[], typing.Awaitable[SendableMessage]], ] = None, *, - schedule: typing.List[ScheduledTask], + schedule: list[ScheduledTask], **kwargs: PublishParameters, ) -> "AsyncTaskiqDecoratedTask[[], None]": """Register FastStream scheduled task. diff --git a/taskiq_faststream/formatter.py b/taskiq_faststream/formatter.py index aa9bcc8..5ed1cc2 100644 --- a/taskiq_faststream/formatter.py +++ b/taskiq_faststream/formatter.py @@ -1,5 +1,5 @@ from dataclasses import dataclass -from typing import Any, Dict +from typing import Any from taskiq.abc.formatter import TaskiqFormatter from taskiq.message import TaskiqMessage @@ -10,7 +10,7 @@ class PathcedMessage: """DTO to transfer data to `broker.kick`.""" body: Any - labels: Dict[str, Any] + labels: dict[str, Any] class PatchedFormatter(TaskiqFormatter): diff --git a/tests/test_resolve_message.py b/tests/test_resolve_message.py index 51c74a5..3bcdfef 100644 --- a/tests/test_resolve_message.py +++ b/tests/test_resolve_message.py @@ -1,4 +1,4 @@ -from typing import AsyncIterator, Iterator +from collections.abc import AsyncIterator, Iterator import pytest diff --git a/tests/testcase.py b/tests/testcase.py index 2aa958f..c22b7ff 100644 --- a/tests/testcase.py +++ b/tests/testcase.py @@ -1,5 +1,5 @@ import asyncio -from datetime import datetime +from datetime import datetime, timezone from typing import Any from unittest.mock import MagicMock @@ -44,7 +44,7 @@ async def handler(msg: str) -> None: **{self.subj_name: subject}, schedule=[ { - "time": datetime.utcnow(), # old python compat + "time": datetime.now(tz=timezone.utc), }, ], ) From 31daeb519058c0501e85718a52fdae5b8ef93fb6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 3 May 2025 14:38:01 +0000 Subject: [PATCH 04/11] chore(deps): bump the pip group with 3 updates Updates the requirements on [mypy](https://github.com/python/mypy), [ruff](https://github.com/astral-sh/ruff) and [pre-commit](https://github.com/pre-commit/pre-commit) to permit the latest version. Updates `mypy` to 1.15.0 - [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md) - [Commits](https://github.com/python/mypy/compare/v1.8.0...v1.15.0) Updates `ruff` from 0.4.1 to 0.11.8 - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md) - [Commits](https://github.com/astral-sh/ruff/compare/v0.4.1...0.11.8) Updates `pre-commit` to 4.2.0 - [Release notes](https://github.com/pre-commit/pre-commit/releases) - [Changelog](https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md) - [Commits](https://github.com/pre-commit/pre-commit/compare/v3.6.0...v4.2.0) --- updated-dependencies: - dependency-name: mypy dependency-version: 1.15.0 dependency-type: direct:production dependency-group: pip - dependency-name: ruff dependency-version: 0.11.8 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: pip - dependency-name: pre-commit dependency-version: 4.2.0 dependency-type: direct:production dependency-group: pip ... Signed-off-by: dependabot[bot] --- pyproject.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index cd427f2..1d3255c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -82,9 +82,9 @@ test = [ dev = [ "taskiq-faststream[test]", - "mypy>=1.8.0,<1.12.0", - "ruff==0.4.1", - "pre-commit >=3.6.0,<4.0.0", + "mypy>=1.8.0,<1.16.0", + "ruff==0.11.8", + "pre-commit >=3.6.0,<5.0.0", ] [project.urls] From 933c19de0b729e7eb1a4913b36bef65a62cdbce7 Mon Sep 17 00:00:00 2001 From: Nikita Pastukhov Date: Sat, 3 May 2025 17:54:27 +0300 Subject: [PATCH 05/11] feat (#77): correct AppWrapper types --- pyproject.toml | 3 +-- taskiq_faststream/broker.py | 6 +++--- tests/test_kafka.py | 7 +++++++ tests/test_nats.py | 7 +++++++ tests/test_rabbit.py | 7 +++++++ tests/test_redis.py | 7 +++++++ 6 files changed, 32 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 1d3255c..69998c2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -81,8 +81,7 @@ test = [ dev = [ "taskiq-faststream[test]", - - "mypy>=1.8.0,<1.16.0", + "mypy==1.11.2", "ruff==0.11.8", "pre-commit >=3.6.0,<5.0.0", ] diff --git a/taskiq_faststream/broker.py b/taskiq_faststream/broker.py index 4b5fe9a..4ed4e7e 100644 --- a/taskiq_faststream/broker.py +++ b/taskiq_faststream/broker.py @@ -3,7 +3,7 @@ from typing import Any import anyio -from faststream.app import FastStream +from faststream._internal.application import Application from faststream.types import SendableMessage from taskiq import AsyncBroker from taskiq.acks import AckableMessage @@ -66,7 +66,7 @@ async def listen( yield b"" await anyio.sleep(60) - def task( + def task( # type: ignore[override] self, message: typing.Union[ None, @@ -106,7 +106,7 @@ class AppWrapper(BrokerWrapper): task : Register FastStream scheduled task. """ - def __init__(self, app: FastStream) -> None: + def __init__(self, app: Application) -> None: super(BrokerWrapper, self).__init__() self.formatter = PatchedFormatter() self.app = app diff --git a/tests/test_kafka.py b/tests/test_kafka.py index f93989b..56e65ef 100644 --- a/tests/test_kafka.py +++ b/tests/test_kafka.py @@ -23,3 +23,10 @@ class TestApp(TestBroker): def build_taskiq_broker(broker: KafkaBroker) -> AsyncBroker: """Build AppWrapper.""" return AppWrapper(FastStream(broker)) + + +class TestAsgiApp(TestBroker): + @staticmethod + def build_taskiq_broker(broker: KafkaBroker) -> AsyncBroker: + """Build AppWrapper.""" + return AppWrapper(FastStream(broker).as_asgi()) diff --git a/tests/test_nats.py b/tests/test_nats.py index a2ed69d..7c7e8c4 100644 --- a/tests/test_nats.py +++ b/tests/test_nats.py @@ -23,3 +23,10 @@ class TestApp(TestBroker): def build_taskiq_broker(broker: NatsBroker) -> AsyncBroker: """Build AppWrapper.""" return AppWrapper(FastStream(broker)) + + +class TestAsgiApp(TestBroker): + @staticmethod + def build_taskiq_broker(broker: NatsBroker) -> AsyncBroker: + """Build AppWrapper.""" + return AppWrapper(FastStream(broker).as_asgi()) diff --git a/tests/test_rabbit.py b/tests/test_rabbit.py index 5d6fdf1..f87f790 100644 --- a/tests/test_rabbit.py +++ b/tests/test_rabbit.py @@ -23,3 +23,10 @@ class TestApp(TestBroker): def build_taskiq_broker(broker: RabbitBroker) -> AsyncBroker: """Build AppWrapper.""" return AppWrapper(FastStream(broker)) + + +class TestAsgiApp(TestBroker): + @staticmethod + def build_taskiq_broker(broker: RabbitBroker) -> AsyncBroker: + """Build AppWrapper.""" + return AppWrapper(FastStream(broker).as_asgi()) diff --git a/tests/test_redis.py b/tests/test_redis.py index d08d58f..d98b9c0 100644 --- a/tests/test_redis.py +++ b/tests/test_redis.py @@ -23,3 +23,10 @@ class TestApp(TestBroker): def build_taskiq_broker(broker: RedisBroker) -> AsyncBroker: """Build AppWrapper.""" return AppWrapper(FastStream(broker)) + + +class TestAsgiApp(TestBroker): + @staticmethod + def build_taskiq_broker(broker: RedisBroker) -> AsyncBroker: + """Build AppWrapper.""" + return AppWrapper(FastStream(broker).as_asgi()) From d44846c065f6722cb06efe9d26feca911dcc3cc2 Mon Sep 17 00:00:00 2001 From: Nikita Pastukhov Date: Sat, 3 May 2025 18:00:58 +0300 Subject: [PATCH 06/11] chore: change CI triggers --- .github/workflows/test.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 845cb57..99fc62c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,7 +5,10 @@ on: branches: - master pull_request: - types: [opened, synchronize] + types: + - opened + - synchronize + - ready_for_review jobs: static_analysis: From e1695421f338267be5d6090758809dea5bfc22e2 Mon Sep 17 00:00:00 2001 From: Nikita Pastukhov Date: Sat, 3 May 2025 18:04:25 +0300 Subject: [PATCH 07/11] chore: fix CI --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 99fc62c..6e15d74 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -43,7 +43,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.9", "3.10", "3.11", "3.12, "3.13"] + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] fail-fast: false steps: From 78d01b39449f2780301a207e6a78f6a019d8d83c Mon Sep 17 00:00:00 2001 From: Nikita Pastukhov Date: Sat, 3 May 2025 18:05:51 +0300 Subject: [PATCH 08/11] docs: update README --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index ed4f298..c3789e9 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,8 @@ pip install taskiq-faststream[rabbit] pip install taskiq-faststream[kafka] # or pip install taskiq-faststream[nats] +# or +pip install taskiq-faststream[redis] ``` ## Usage From 495766779f95ed8205c0ff905579cfb06599913d Mon Sep 17 00:00:00 2001 From: Nikita Pastukhov Date: Sat, 3 May 2025 18:07:14 +0300 Subject: [PATCH 09/11] chore: fix CI --- .github/workflows/test.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6e15d74..a532eaa 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -72,6 +72,7 @@ jobs: name: .coverage.${{ runner.os }}-py${{ matrix.python-version }}-${{ matrix.pydantic-version }} path: coverage if-no-files-found: error + include-hidden-files: true coverage-combine: needs: [test] @@ -103,6 +104,8 @@ jobs: with: name: coverage-html path: htmlcov + if-no-files-found: error + include-hidden-files: true # https://github.com/marketplace/actions/alls-green#why check: # This job does nothing and is only used for the branch protection From ca6005c5b50948627d6704f12d066d0ce4b58888 Mon Sep 17 00:00:00 2001 From: Nikita Pastukhov Date: Sat, 3 May 2025 18:12:12 +0300 Subject: [PATCH 10/11] chore: use uv in CI --- .github/workflows/test.yml | 29 ++++++++++++++++++----------- scripts/lint.sh | 6 +++--- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a532eaa..13fd732 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,24 +19,24 @@ jobs: - uses: actions/setup-python@v5 with: python-version: 3.9 + - uses: astral-sh/setup-uv@v6 + with: + version: "latest" - name: Install Dependencies and library shell: bash - run: | - set -ux - python -m pip install --upgrade pip - pip install -e ".[dev]" + run: uv pip install --system ".[dev]" - name: Run formatter shell: bash run: ruff format taskiq_faststream - - name: Run mypy + - name: Run ruff shell: bash - run: mypy taskiq_faststream + run: ruff check taskiq_faststream - - name: Run ruff + - name: Run mypy shell: bash - run: ruff taskiq_faststream + run: mypy taskiq_faststream test: if: github.event.pull_request.draft == false @@ -52,6 +52,9 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + - uses: astral-sh/setup-uv@v6 + with: + version: "latest" - uses: actions/cache@v4 id: cache with: @@ -59,7 +62,7 @@ jobs: key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-test-v03 - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' - run: pip install -e .[test] + run: uv pip install --system ".[test]" - run: mkdir coverage - name: Test run: bash scripts/test.sh @@ -83,7 +86,11 @@ jobs: - uses: actions/setup-python@v5 with: - python-version: '3.8' + python-version: 3.9 + + - uses: astral-sh/setup-uv@v6 + with: + version: "latest" - name: Get coverage files uses: actions/download-artifact@v4 @@ -92,7 +99,7 @@ jobs: path: coverage merge-multiple: true - - run: pip install coverage[toml] + - run: uv pip install --system "coverage[toml]" - run: ls -la coverage - run: coverage combine coverage diff --git a/scripts/lint.sh b/scripts/lint.sh index ba0c426..829cb45 100755 --- a/scripts/lint.sh +++ b/scripts/lint.sh @@ -1,10 +1,10 @@ #!/bin/bash -echo "Running ruff..." -ruff check taskiq_faststream tests --fix - echo "Running ruff formatter..." ruff format taskiq_faststream tests +echo "Running ruff..." +ruff check taskiq_faststream tests --fix + echo "Running mypy..." mypy taskiq_faststream From 41e3b500368c800ef584d9661457f90fcdca03c0 Mon Sep 17 00:00:00 2001 From: Nikita Pastukhov Date: Sat, 3 May 2025 18:16:54 +0300 Subject: [PATCH 11/11] chore: use cache in CI --- .github/workflows/test.yml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 13fd732..8328bd4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,21 +19,26 @@ jobs: - uses: actions/setup-python@v5 with: python-version: 3.9 + + - uses: actions/cache@v4 + id: cache + with: + path: ${{ env.pythonLocation }} + key: ${{ runner.os }}-static-analysis-${{ hashFiles('pyproject.toml') }}-test-v03 - uses: astral-sh/setup-uv@v6 + if: steps.cache.outputs.cache-hit != 'true' with: version: "latest" - - name: Install Dependencies and library - shell: bash + - name: Install Dependencies + if: steps.cache.outputs.cache-hit != 'true' run: uv pip install --system ".[dev]" - name: Run formatter shell: bash run: ruff format taskiq_faststream - - name: Run ruff shell: bash run: ruff check taskiq_faststream - - name: Run mypy shell: bash run: mypy taskiq_faststream @@ -52,17 +57,20 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - - uses: astral-sh/setup-uv@v6 - with: - version: "latest" + - uses: actions/cache@v4 id: cache with: path: ${{ env.pythonLocation }} key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-test-v03 + - uses: astral-sh/setup-uv@v6 + if: steps.cache.outputs.cache-hit != 'true' + with: + version: "latest" - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' run: uv pip install --system ".[test]" + - run: mkdir coverage - name: Test run: bash scripts/test.sh