Skip to content

Commit 6b4c1c8

Browse files
committed
fix latest ci
1 parent 09e354d commit 6b4c1c8

6 files changed

Lines changed: 15 additions & 9 deletions

File tree

noxfile.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ def python_version_less(*version: int) -> Constraint:
5757
IntegrationEnv("faststream", "050", python_version_less(3, 13)),
5858
IntegrationEnv("faststream", "0529", python_version_less(3, 14)),
5959
IntegrationEnv("faststream", "060"),
60+
IntegrationEnv("faststream", "070"),
6061
IntegrationEnv("faststream", "latest"),
6162
IntegrationEnv("flask", "302"),
6263
IntegrationEnv("flask", "latest"),

requirements/faststream-070.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-r test.txt
2+
3+
faststream[nats]==0.7.1
4+
fast-depends==3.0.8

requirements/test.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
pytest~=9.0.1
2-
pytest-asyncio==1.3.*
2+
pytest-asyncio==1.4.*
33
pytest-repeat==0.9.*
44
pytest-cov==7.*

src/dishka/integrations/faststream/__init__.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,11 @@
1515
stacklevel=2,
1616
)
1717

18-
FASTSTREAM_05 = FASTSTREAM_VERSION.startswith("0.5")
19-
FASTSTREAM_06 = FASTSTREAM_VERSION.startswith("0.6")
20-
21-
if FASTSTREAM_05:
18+
if FASTSTREAM_VERSION.startswith("0.5"):
2219
from .faststream_05 import FastStreamProvider, inject, setup_dishka
23-
elif FASTSTREAM_06:
20+
elif (
21+
FASTSTREAM_VERSION.startswith(("0.6", "0.7"))
22+
):
2423
from .faststream_06 import ( # type: ignore[assignment]
2524
FastStreamProvider,
2625
inject,

src/dishka/integrations/faststream/faststream_06.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,10 @@ class FastStreamProvider(Provider):
4141

4242
try:
4343
# import works only if fastapi is installed
44-
from faststream._internal.fastapi import Context as FastAPIContext
45-
from faststream._internal.fastapi import StreamRouter
44+
from faststream._internal.fastapi import (
45+
Context as FastAPIContext,
46+
StreamRouter,
47+
)
4648

4749
except ImportError:
4850
ContextAnnotation: TypeAlias = Annotated[ContextRepo, Context("context")]

tests/integrations/faststream/test_faststream_05.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
# `broker.request` was introduced in FastStream 0.5.19
2929
# `broker.publish(..., rpc=True)` was removed in FastStream 0.6.0rc0
30-
if FASTSTREAM_VERSION.startswith("0.6"):
30+
if FASTSTREAM_VERSION.startswith(("0.6", "0.7")):
3131
pytestmark = pytest.mark.skip(
3232
reason="These tests is not compatible with FastStream 0.6",
3333
)

0 commit comments

Comments
 (0)