From a584e25fad5e77ecd6950724102ef838bcd735c1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Dec 2023 18:33:24 +0000 Subject: [PATCH 01/10] chore(deps): bump pypa/gh-action-pypi-publish from 1.8.10 to 1.8.11 Bumps [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) from 1.8.10 to 1.8.11. - [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases) - [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/v1.8.10...v1.8.11) --- updated-dependencies: - dependency-name: pypa/gh-action-pypi-publish dependency-type: direct:production update-type: version-update:semver-patch ... 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 ab596c8..61872d3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -38,7 +38,7 @@ jobs: run: python -m build - name: Publish - uses: pypa/gh-action-pypi-publish@v1.8.10 + uses: pypa/gh-action-pypi-publish@v1.8.11 with: password: ${{ secrets.PYPI_TOKEN }} From 1f678815688bf3777ec463c873c69eb00730d23f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Dec 2023 18:41:44 +0000 Subject: [PATCH 02/10] chore(deps): bump actions/setup-python from 4 to 5 Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/release.yml | 2 +- .github/workflows/test.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 61872d3..52c8224 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: "3.8" cache: "pip" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7263a23..18ee659 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: 3.8 - name: Install Dependencies and library @@ -46,7 +46,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - uses: actions/cache@v3 @@ -76,7 +76,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: '3.8' From 6091fa11cbb337c5c06f5a58a6b09b85794a88a9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Dec 2023 18:55:51 +0000 Subject: [PATCH 03/10] chore(deps-dev): bump isort from 5.12.0 to 5.13.0 Bumps [isort](https://github.com/pycqa/isort) from 5.12.0 to 5.13.0. - [Release notes](https://github.com/pycqa/isort/releases) - [Changelog](https://github.com/PyCQA/isort/blob/main/CHANGELOG.md) - [Commits](https://github.com/pycqa/isort/compare/5.12.0...5.13.0) --- updated-dependencies: - dependency-name: isort dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 7d12431..836f515 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -73,7 +73,7 @@ dev = [ "mypy==1.7.1", "black==23.11.0", - "isort==5.12.0", + "isort==5.13.0", "ruff==0.1.6", "pyupgrade-directories==0.3.0", "pre-commit==3.5.0", From 9b1b09b7daf3b499d58416147899bc50cd214c21 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Dec 2023 18:39:55 +0000 Subject: [PATCH 04/10] chore(deps-dev): bump isort from 5.13.0 to 5.13.2 Bumps [isort](https://github.com/pycqa/isort) from 5.13.0 to 5.13.2. - [Release notes](https://github.com/pycqa/isort/releases) - [Changelog](https://github.com/PyCQA/isort/blob/main/CHANGELOG.md) - [Commits](https://github.com/pycqa/isort/compare/5.13.0...5.13.2) --- updated-dependencies: - dependency-name: isort dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 836f515..b51dfb8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -73,7 +73,7 @@ dev = [ "mypy==1.7.1", "black==23.11.0", - "isort==5.13.0", + "isort==5.13.2", "ruff==0.1.6", "pyupgrade-directories==0.3.0", "pre-commit==3.5.0", From 06a3d72774fcbe9f1350029677a547631c19f4f6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Dec 2023 18:40:00 +0000 Subject: [PATCH 05/10] chore(deps-dev): bump black from 23.11.0 to 23.12.0 Bumps [black](https://github.com/psf/black) from 23.11.0 to 23.12.0. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/compare/23.11.0...23.12.0) --- updated-dependencies: - dependency-name: black dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 836f515..26aeecb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -72,7 +72,7 @@ dev = [ "taskiq-faststream[test]", "mypy==1.7.1", - "black==23.11.0", + "black==23.12.0", "isort==5.13.0", "ruff==0.1.6", "pyupgrade-directories==0.3.0", From da79bf22d5b91150ca56d29079b8715731d1ff68 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 20 Dec 2023 15:42:20 +0000 Subject: [PATCH 06/10] chore(deps-dev): bump ruff from 0.1.6 to 0.1.8 Bumps [ruff](https://github.com/astral-sh/ruff) from 0.1.6 to 0.1.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.1.6...v0.1.8) --- updated-dependencies: - dependency-name: ruff dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 0ef48b6..f37665d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -74,7 +74,7 @@ dev = [ "mypy==1.7.1", "isort==5.13.2", "black==23.12.0", - "ruff==0.1.6", + "ruff==0.1.8", "pyupgrade-directories==0.3.0", "pre-commit==3.5.0", ] From dde0bd4df70217af1fd147b51b06a3b0dcb859c5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 20 Dec 2023 15:42:53 +0000 Subject: [PATCH 07/10] chore(deps-dev): bump pre-commit from 3.5.0 to 3.6.0 Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 3.5.0 to 3.6.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.5.0...v3.6.0) --- updated-dependencies: - dependency-name: pre-commit dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 0ef48b6..73ad124 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -76,7 +76,7 @@ dev = [ "black==23.12.0", "ruff==0.1.6", "pyupgrade-directories==0.3.0", - "pre-commit==3.5.0", + "pre-commit==3.6.0", ] [project.urls] From 9d098b1586ef9c8b04e59b70d0a2c075071f7a75 Mon Sep 17 00:00:00 2001 From: Nikita Pastukhov Date: Sat, 6 Jan 2024 13:42:17 +0300 Subject: [PATCH 08/10] chore: update dependencies --- .github/workflows/release.yml | 1 + .github/workflows/test.yml | 22 ++++++++++++---------- pyproject.toml | 26 ++++++++++++++++---------- scripts/lint.sh | 7 ++----- tests/test_redis.py | 25 +++++++++++++++++++++++++ 5 files changed, 56 insertions(+), 25 deletions(-) create mode 100644 tests/test_redis.py diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 52c8224..e92336d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,6 +1,7 @@ name: Release python package on: + workflow_dispatch: null push: tags: - "*" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 18ee659..a0c4acf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,9 +23,9 @@ jobs: python -m pip install --upgrade pip pip install -e ".[dev]" - - name: Run black + - name: Run formatter shell: bash - run: black taskiq_faststream + run: ruff format taskiq_faststream - name: Run mypy shell: bash @@ -40,7 +40,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] fail-fast: false steps: @@ -61,13 +61,14 @@ jobs: - name: Test run: bash scripts/test.sh env: - COVERAGE_FILE: coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }} - CONTEXT: ${{ runner.os }}-py${{ matrix.python-version }} + COVERAGE_FILE: coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }}-${{ matrix.pydantic-version }} + CONTEXT: ${{ runner.os }}-py${{ matrix.python-version }}-${{ matrix.pydantic-version }} - name: Store coverage files - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: coverage + name: .coverage.${{ runner.os }}-py${{ matrix.python-version }}-${{ matrix.pydantic-version }} path: coverage + if-no-files-found: error coverage-combine: needs: [test] @@ -81,10 +82,11 @@ jobs: python-version: '3.8' - name: Get coverage files - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: - name: coverage + pattern: .coverage* path: coverage + merge-multiple: true - run: pip install coverage[toml] @@ -94,7 +96,7 @@ jobs: - run: coverage html --show-contexts --title "taskiq-faststream coverage for ${{ github.sha }}" - name: Store coverage html - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: coverage-html path: htmlcov diff --git a/pyproject.toml b/pyproject.toml index e71d8e1..b14123c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,6 +25,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Operating System :: OS Independent", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Software Development :: Libraries", @@ -42,7 +43,7 @@ dynamic = ["version"] dependencies = [ "taskiq>=0.10.0,<1.0.0", - "faststream>=0.2.12,<1.0.0", + "faststream>=0.3.0,<1.0.0", ] [project.optional-dependencies] @@ -58,25 +59,27 @@ kafka = [ "faststream[kafka]" ] +redis = [ + "faststream[redis]" +] + # local dev test = [ "taskiq-faststream[nats]", "taskiq-faststream[rabbit]", "taskiq-faststream[kafka]", + "taskiq-faststream[redis]", "coverage[toml]>=7.2.0,<8.0.0", - "pytest==7.4.3", + "pytest>=7.4.0,<8", ] dev = [ "taskiq-faststream[test]", - "mypy==1.7.1", - "isort==5.13.2", - "black==23.12.0", - "ruff==0.1.8", - "pyupgrade-directories==0.3.0", - "pre-commit==3.6.0", + "mypy>=1.8.0,<1.9.0", + "ruff==0.1.11", + "pre-commit >=3.6.0,<4.0.0", ] [project.urls] @@ -139,6 +142,8 @@ select = [ "ISC", # Implicit string concat "PIE", # Unnecessary code "T20", # Catch prints + "UP", # pyupgrade + "PERF",# perfomance checks "PYI", # validate pyi files "Q", # Checks for quotes "RSE", # Checks raise statements @@ -162,6 +167,8 @@ ignore = [ "ANN401", # typing.Any are disallowed in `**kwargs "PLR0913", # Too many arguments for function call "D106", # Missing docstring in public nested class + "COM812", + "ISC001", ] exclude = [".venv/"] @@ -211,8 +218,7 @@ omit = [ [tool.coverage.report] show_missing = true skip_empty = true -exclude_lines = [ - ".*# pragma: no cover", +exclude_also = [ "if __name__ == .__main__.:", "self.logger", "def __repr__", diff --git a/scripts/lint.sh b/scripts/lint.sh index 8d4159b..9203bc1 100644 --- a/scripts/lint.sh +++ b/scripts/lint.sh @@ -1,13 +1,10 @@ #!/bin/bash -echo "Running pyup_dirs..." -pyup_dirs --py38-plus --recursive taskiq_faststream tests - echo "Running ruff..." ruff taskiq_faststream tests --fix -echo "Running black..." -black taskiq_faststream tests +echo "Running ruff formatter..." +ruff format taskiq_faststream tests echo "Running mypy..." mypy taskiq_faststream diff --git a/tests/test_redis.py b/tests/test_redis.py new file mode 100644 index 0000000..d08d58f --- /dev/null +++ b/tests/test_redis.py @@ -0,0 +1,25 @@ +import pytest +from faststream import FastStream +from faststream.redis import RedisBroker, TestRedisBroker +from taskiq import AsyncBroker + +from taskiq_faststream import AppWrapper + +from .testcase import SchedulerTestcase + + +@pytest.fixture +def broker() -> RedisBroker: + return RedisBroker() + + +class TestBroker(SchedulerTestcase): + test_class = TestRedisBroker + subj_name = "channel" + + +class TestApp(TestBroker): + @staticmethod + def build_taskiq_broker(broker: RedisBroker) -> AsyncBroker: + """Build AppWrapper.""" + return AppWrapper(FastStream(broker)) From 182a648c0337e28cd284bae1d929d0fd82760439 Mon Sep 17 00:00:00 2001 From: Nikita Pastukhov Date: Sat, 6 Jan 2024 13:44:06 +0300 Subject: [PATCH 09/10] chore: bump version --- taskiq_faststream/__about__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/taskiq_faststream/__about__.py b/taskiq_faststream/__about__.py index 0e6753b..bf17a0a 100644 --- a/taskiq_faststream/__about__.py +++ b/taskiq_faststream/__about__.py @@ -1,2 +1,2 @@ """FastStream - taskiq integration to schedule FastStream tasks.""" -__version__ = "0.1.5" +__version__ = "0.1.6" From b7d5d07858f64155b60296aed9bc02deaa6933c6 Mon Sep 17 00:00:00 2001 From: Nikita Pastukhov Date: Sat, 6 Jan 2024 13:46:20 +0300 Subject: [PATCH 10/10] chore: update python in 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 a0c4acf..a17da68 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: 3.9 - name: Install Dependencies and library shell: bash run: |