fix: cap fastapi below 0.140 and adopt ruff 0.16.0 - #153
Merged
Conversation
fastapi 0.140.0 made Dependant a slotted dataclass with no `model` field. faststream's FastAPI integration assigns `dependant.model`, so every FastStream-in-FastAPI route raised AttributeError (ag2ai/faststream#2959). faststream declares no fastapi dependency of its own, so the `fastapi` extra here is the only place the pairing can be constrained; cap it in both the extra and the dev group. ruff 0.16.0 stabilized CPY001 out of preview and started flagging ISC004 and an unused BLE001 noqa. Ignore CPY001 repo-wide, matching modern-di; take the two autofixes. 0.16.0 also formats Python code blocks inside Markdown; reformat the 17 affected files.
Benchmark gate✅ gate passed
Gated (fails the build): |
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.
Fixes #152.
Two unrelated upstream releases landed between last Monday's green run and today's failure.
fastapi 0.140.0 (2026-07-24) — the test break
fastapi 0.140.0 made
Dependanta slotted dataclass, andmodelis no longer a field. faststream 0.7.2 assignsdependant.modelin_internal/fastapi/get_dependant.py:131, so every FastStream-in-FastAPI route now raises:That failed 6 tests in
tests/test_fastapi.pyon 3.11–3.14 and free-threaded. The bug is upstream in faststream, tracked at ag2ai/faststream#2959 (opened the same day); no fix is released.Why cap the published extra, not just dev: faststream 0.7.2 declares no fastapi dependency at all — not even an optional extra (its extras are
cli, confluent, kafka, mqtt, nats, otel, prometheus, rabbit, redis). It reaches FastAPI through an optional import and expects the caller to supply it. So nothing in the dependency graph stops a freshpip install faststream-outbox[fastapi]from resolving fastapi 0.140.0 and handing the user a broken integration. This extra is the only place the pairing can be constrained.The exit is clean: when faststream ships the fix, drop the fastapi cap and raise the faststream floor instead. Both cap sites carry a comment saying so.
ruff 0.16.0 (2026-07-23) — the lint break
missing-copyright-notice) left preview, soselect = ["ALL"]now selects it — 62 hits. Ignored, matching the existing entry inmodern-di.noqa: BLE001, both autofixable — taken as-is.Verified against ruff 0.15.22 (last week's green run): both
checkandformatwere clean, so every lint finding here is new in 0.16.0.Verification
just lint-cigreen locally.just testneeds docker (unavailable on this machine), so I ran the two affected files directly against the pinned fastapi 0.139.2: 301 passed, including all 10 intests/test_fastapi.py. CI covers the rest.🤖 Generated with Claude Code