fix: make the floors job run the faststream suite at its floor - #258
Merged
Merged
Conversation
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 Report✅ All modified and coverable lines are covered by tests.
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
3 of 6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #257. It closes the known gap noted there: the floors job skipped
tests/integrations/faststreamon 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 topydantic._internal._annotated_handlers, which no longer exists, andimport faststreamfails. 0.5.29 adds a>= "2.10"fallback, and 0.5.30 parses the version properly. The floors job resolved pydantic 2.13, sopytest.importorskip("faststream")skipped the whole suite.Options considered:
--no-buildno 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.Changes
tests/integrations/__init__.py: animport_or_skiphelper. WithREQUIRE_INTEGRATIONSset it imports the module directly, so an import error fails collection with the real traceback. Without it, it behaves likepytest.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.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 andpytestcommands withREQUIRE_INTEGRATIONS=1), resolving faststream 0.5.29, pydantic 2.13.5, fast-depends 2.4.12:The faststream suite has 2 tests, and they now run and pass at the floor on every interpreter.
Checklist
ruff)mypyandpyrefly)--covat 100% on 3.12;faststream<0.6.0integration tests passuv build) if packaging or build config changed: only an extra's floor changed, so no build was run