From 40adc62a05199f5e86e5946866100f9120a7efa8 Mon Sep 17 00:00:00 2001 From: Artur Shiriev Date: Sat, 3 Oct 2026 12:38:12 +0300 Subject: [PATCH 1/2] ci: fail the floors job when an integration cannot be imported The integration test packages skip themselves when their framework does not import. The floors job installs every integration, so a skip there means the declared floor is broken. With REQUIRE_INTEGRATIONS set, the import error fails collection instead. --- .github/workflows/_checks.yml | 2 ++ tests/integrations/__init__.py | 9 +++++++++ tests/integrations/fastapi/__init__.py | 4 ++-- tests/integrations/faststream/__init__.py | 6 +++--- tests/integrations/litestar/__init__.py | 4 ++-- 5 files changed, 18 insertions(+), 7 deletions(-) diff --git a/.github/workflows/_checks.yml b/.github/workflows/_checks.yml index 6ff11048..cc690c3f 100644 --- a/.github/workflows/_checks.yml +++ b/.github/workflows/_checks.yml @@ -75,6 +75,8 @@ jobs: - run: uv pip compile pyproject.toml --all-extras --no-deps --resolution lowest-direct -o floors.txt - run: uv pip install -r pyproject.toml --all-extras --group dev --constraints floors.txt --no-build - run: uv run --no-sync pytest . + env: + REQUIRE_INTEGRATIONS: "1" links: runs-on: ubuntu-latest diff --git a/tests/integrations/__init__.py b/tests/integrations/__init__.py index e69de29b..603ee3fe 100644 --- a/tests/integrations/__init__.py +++ b/tests/integrations/__init__.py @@ -0,0 +1,9 @@ +import importlib +import os +import types + +import pytest + + +def import_or_skip(module: str) -> types.ModuleType: + return importlib.import_module(module) if os.environ.get("REQUIRE_INTEGRATIONS") else pytest.importorskip(module) diff --git a/tests/integrations/fastapi/__init__.py b/tests/integrations/fastapi/__init__.py index 594a83ac..6045c718 100644 --- a/tests/integrations/fastapi/__init__.py +++ b/tests/integrations/fastapi/__init__.py @@ -1,4 +1,4 @@ -import pytest +from tests.integrations import import_or_skip -pytest.importorskip("fastapi") +import_or_skip("fastapi") diff --git a/tests/integrations/faststream/__init__.py b/tests/integrations/faststream/__init__.py index 9c7848a6..58addac4 100644 --- a/tests/integrations/faststream/__init__.py +++ b/tests/integrations/faststream/__init__.py @@ -1,5 +1,5 @@ -import pytest +from tests.integrations import import_or_skip -pytest.importorskip("faststream") -pytest.importorskip("nats") +import_or_skip("faststream") +import_or_skip("nats") diff --git a/tests/integrations/litestar/__init__.py b/tests/integrations/litestar/__init__.py index edeba252..debff2bd 100644 --- a/tests/integrations/litestar/__init__.py +++ b/tests/integrations/litestar/__init__.py @@ -1,4 +1,4 @@ -import pytest +from tests.integrations import import_or_skip -pytest.importorskip("litestar") +import_or_skip("litestar") From 0d6bd7540616febb1f893d1bc7af23f3409ca697 Mon Sep 17 00:00:00 2001 From: Artur Shiriev Date: Sat, 3 Oct 2026 12:39:34 +0300 Subject: [PATCH 2/2] fix: raise the faststream floor to 0.5.29 faststream before 0.5.29 compares the pydantic version as a string, so pydantic 2.10 and later sorts below "2.4.0" and faststream imports a module pydantic no longer has. pydantic has no 3.14 wheels before 2.12, so no older faststream can be imported on every supported Python. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 7f9dd40c..f40dc21f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,7 @@ fastapi = [ "fastapi>=0.115.3", ] faststream = [ - "faststream>=0.5.19", + "faststream>=0.5.29", "packaging", ]