Skip to content

fix: make the floors job run the faststream suite at its floor - #258

Merged
lesnik512 merged 2 commits into
mainfrom
ci/floors-faststream
Oct 3, 2026
Merged

lesnik512 merged 2 commits into
mainfrom
ci/floors-faststream

Conversation

@lesnik512

@lesnik512 lesnik512 commented Oct 3, 2026 •

Copy link
Copy Markdown
Member

Summary

Follow-up to #257. It closes the known gap noted there: the floors job skipped tests/integrations/faststream on every Python.

faststream before 0.5.29 checks the pydantic version with a string comparison in faststream/_compat.py: PYDANTIC_VERSION >= "2.4.0". For pydantic 2.10 and later that comparison is False ("2.13.5" < "2.4.0"), so faststream falls back to pydantic._internal._annotated_handlers, which no longer exists, and import faststream fails. 0.5.29 adds a >= "2.10" fallback, and 0.5.30 parses the version properly. The floors job resolved pydantic 2.13, so pytest.importorskip("faststream") skipped the whole suite.

Options considered:

  • Constrain pydantic in the floors job. Does not work. pydantic has no 3.14 wheels before 2.12, and every 2.10+ release hits the string comparison, so with --no-build no pydantic lets faststream <0.5.29 import on 3.14. On 3.10-3.13 it would mean pinning pydantic <2.10 per interpreter, which tests a combination real users stopped getting in November 2024.
  • Raise the faststream floor. 0.5.29 is the lowest release that imports next to pydantic 2.10+. It was checked by replaying the job's commands on 3.10-3.14; 0.5.28 still skips on 3.10 and 3.14.
  • Fail loudly instead of skipping. Done as well, so a future import breakage at the floors fails the job instead of hiding again.

Changes

  • tests/integrations/__init__.py: an import_or_skip helper. With REQUIRE_INTEGRATIONS set it imports the module directly, so an import error fails collection with the real traceback. Without it, it behaves like pytest.importorskip, which keeps the integration suites optional for local runs. It is one expression so the 100% line-coverage gate holds whether or not the variable is set.
  • The fastapi, faststream and litestar test packages use the helper.
  • The floors job sets REQUIRE_INTEGRATIONS=1. It installs every extra and the dev group, so a skip there is always a broken floor.
  • faststream>=0.5.29 (was 0.5.19).

The commits are in TDD order. The first commit only turns the guard on, and at 0.5.19 the floors job fails with 2 collection errors in tests/integrations/faststream (reproduced locally on 3.12). The second raises the floor.

Local replay of the floors job (uv venv -p X, then the job's compile, install and pytest commands with REQUIRE_INTEGRATIONS=1), resolving faststream 0.5.29, pydantic 2.13.5, fast-depends 2.4.12:

Python Result
3.10-3.14 458 passed, 0 skipped

The faststream suite has 2 tests, and they now run and pass at the floor on every interpreter.

Checklist

  • Lint and format pass (ruff)
  • Type check passes (mypy and pyrefly)
  • Tests pass and new behavior is covered: full suite with --cov at 100% on 3.12; faststream<0.6.0 integration tests pass
  • Build succeeds (uv build) if packaging or build config changed: only an extra's floor changed, so no build was run
  • Docs updated if behavior or public API changed: no docs mention the faststream floor
  • Repo metadata stays consistent across the three surfaces: unchanged

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.
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.
@codecov

codecov Bot commented Oct 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
tests/integrations/__init__.py 100.00% <100.00%> (ø)
tests/integrations/fastapi/__init__.py 100.00% <100.00%> (ø)
tests/integrations/faststream/__init__.py 100.00% <100.00%> (ø)
tests/integrations/litestar/__init__.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lesnik512
lesnik512 merged commit 04f6cdf into main Oct 3, 2026
18 checks passed
@lesnik512
lesnik512 deleted the ci/floors-faststream branch October 3, 2026 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant