Skip to content

Commit

Permalink
Merge pull request #50 from taskiq-python/develop
Browse files Browse the repository at this point in the history
fix: FastStream 0.5.0 compatibility
  • Loading branch information
Lancetnik authored Apr 22, 2024
2 parents fc48b32 + 5e507fb commit 471b8cb
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
cache: "pip"
cache-dependency-path: pyproject.toml

- uses: actions/cache@v3
- uses: actions/cache@v4
id: cache
with:
path: ${{ env.pythonLocation }}
Expand All @@ -39,7 +39,7 @@ jobs:
run: python -m build

- name: Publish
uses: pypa/[email protected].11
uses: pypa/[email protected].14
with:
password: ${{ secrets.PYPI_TOKEN }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v3
- uses: actions/cache@v4
id: cache
with:
path: ${{ env.pythonLocation }}
Expand Down
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description = "FastStream - taskiq integration to schedule FastStream tasks"
readme = "README.md"
authors = [
{ name = "Taskiq team", email = "[email protected]" },
{ name = "Pastukhov Nikita", email = "[email protected]" },
{ name = "Nikita Pastukhov", email = "[email protected]" },
]

keywords = ["taskiq", "tasks", "distributed", "async", "FastStream"]
Expand Down Expand Up @@ -43,7 +43,7 @@ dynamic = ["version"]

dependencies = [
"taskiq>=0.10.0,<1.0.0",
"faststream>=0.3.14,<0.5.0",
"faststream>=0.3.14,<0.6.0",
]

[project.optional-dependencies]
Expand Down Expand Up @@ -71,14 +71,14 @@ test = [
"taskiq-faststream[redis]",

"coverage[toml]>=7.2.0,<8.0.0",
"pytest>=7.4.0,<8",
"pytest>=7.4.0,<9",
]

dev = [
"taskiq-faststream[test]",

"mypy>=1.8.0,<1.9.0",
"ruff==0.1.13",
"mypy>=1.8.0,<1.10.0",
"ruff==0.4.1",
"pre-commit >=3.6.0,<4.0.0",
]

Expand Down
2 changes: 1 addition & 1 deletion taskiq_faststream/__about__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"""FastStream - taskiq integration to schedule FastStream tasks."""
__version__ = "0.1.7"
__version__ = "0.1.8"
6 changes: 3 additions & 3 deletions taskiq_faststream/broker.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import typing
import warnings
from typing import Any

import anyio
from faststream.app import FastStream
from faststream.broker.core.asynchronous import BrokerAsyncUsecase
from faststream.types import SendableMessage
from taskiq import AsyncBroker, BrokerMessage
from taskiq.acks import AckableMessage
Expand Down Expand Up @@ -31,7 +31,7 @@ class BrokerWrapper(AsyncBroker):
task : Register FastStream scheduled task.
"""

def __init__(self, broker: BrokerAsyncUsecase[typing.Any, typing.Any]) -> None:
def __init__(self, broker: Any) -> None:
super().__init__()
self.serializer = PatchedSerializer()
self.broker = broker
Expand Down Expand Up @@ -131,7 +131,7 @@ async def kick(self, message: BrokerMessage) -> None:


async def _broker_publish(
broker: BrokerAsyncUsecase[typing.Any, typing.Any],
broker: Any,
message: BrokerMessage,
) -> None:
labels = message.labels
Expand Down
5 changes: 2 additions & 3 deletions tests/testcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from unittest.mock import MagicMock

import pytest
from faststream.broker.core.asynchronous import BrokerAsyncUsecase
from faststream.utils.functions import timeout_scope
from taskiq import AsyncBroker, TaskiqScheduler
from taskiq.cli.scheduler.args import SchedulerArgs
Expand All @@ -20,14 +19,14 @@ class SchedulerTestcase:
subj_name: str

@staticmethod
def build_taskiq_broker(broker: BrokerAsyncUsecase[Any, Any]) -> AsyncBroker:
def build_taskiq_broker(broker: Any) -> AsyncBroker:
"""Build Taskiq compatible object."""
return BrokerWrapper(broker)

async def test_task(
self,
subject: str,
broker: BrokerAsyncUsecase[Any, Any],
broker: Any,
mock: MagicMock,
event: asyncio.Event,
) -> None:
Expand Down

0 comments on commit 471b8cb

Please sign in to comment.