chore(deps): adapt to faststream 0.7.6 and raise its floor - #182
Merged
Merged
Conversation
faststream 0.7.6 replaced the private ASGI try-it-out registry with a `TestBroker.__init_subclass__(broker=...)` hook, made `SubscriberSpec` / `PublisherSpec` carry a required `address`, made `channel_labels` abstract, narrowed `dependencies` to `Sequence`, and turned `__aiter__` back into a plain `def`. The registry monkeypatch goes away entirely in favour of the declarative hook, which also drops a reach into a private symbol. `TestBroker` did not accept the `broker=` kwarg before 0.7.6, so `import faststream_outbox` now fails outright on 0.7.5; the floor moves from 0.7.1 to 0.7.6 to say so. Nothing in CI resolves at the lower bound, which is why the previous floor went stale unnoticed. `publisher.mock` now raises `SetupError` outside a test broker rather than answering with a reset mock, which exposed a vacuous assertion in the relay dual-fire test: it checked `assert_not_called()` after leaving the `TestKafkaBroker` context, where the mock had already been cleared. Moved inside, it tests something. The subscriber keeps its single comma-joined AsyncAPI channel rather than splitting one per queue the way the built-in brokers now do. That is a document-shape decision, not a dependency one: #181.
Benchmark gate✅ gate passed
Gated (fails the build): |
This was referenced Sep 20, 2026
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.
Dependency refresh.
uv.lockis gitignored, so the baseline is a local lock; against the live indexonly these moved:
fastapistays at 0.139.2 under the existing<0.140cap; lifting it is untested here.faststream 0.7.6 accounted for all of it: 5 test failures and 15
tydiagnostics.Upstream changes and the adaptations
The ASGI try-it-out registry monkeypatch is gone. 0.7.6 replaced the private
_get_broker_registrywith aTestBroker.__init_subclass__(broker=...)hook, soTestOutboxBrokerdeclares
broker=OutboxBrokerand the 29-line try/except in__init__.pyis deleted. Net removal,and one fewer reach into a private symbol.
SubscriberSpec/PublisherSpecgained a requiredaddress, andchannel_labelsbecameabstract. Both implemented. The subscriber keeps its single comma-joined channel rather than
splitting one per queue the way the built-in brokers now do; that is a document-shape decision
rather than a dependency one, written up with a verified blast radius in #181.
__aiter__is a plaindefupstream again (declaring itasynctyped it as a coroutine, whichasync forrejects). Shape matched; the unsupported-peek behaviour is unchanged.dependenciesnarrowed fromIterabletoSequenceacross upstream's signatures. Followed atthe four sites in
broker.py,router.py(x2),registrator.py.publisher.mocknow raisesSetupErroroutside a test broker instead of answering with a resetmock. That exposed a vacuous assertion:
test_relay_dual_fire_guard_through_worker_loop_leaves_row_and_logscalled
assert_not_called()after leaving theTestKafkaBrokercontext, where the mock had alreadybeen cleared, so it could not fail. Moved inside the context, it tests something.
Four
ty: ignoresuppressions became redundant and are removed with their comments.The floor was wrong
TestBrokerdid not accept thebroker=kwarg before 0.7.6, so on 0.7.5import faststream_outboxnow fails at import:
Verified by installing the package against
faststream==0.7.5.SubscriberSpec/PublisherSpecalso lack
addressthere. The floor moves0.7.1->0.7.6in both the runtime dependency and thedev group. Nothing in CI resolves at the lower bound, which is why the old floor went stale without
anyone noticing; worth a
UV_RESOLUTION=lowest-directjob, but that is not in this PR.Compatibility
Runtime behaviour is unchanged for anyone already on faststream 0.7.6. Three things are worth
calling out:
That is the point of the floor bump, and it is a real narrowing for anyone pinning 0.7.1-0.7.5,
though such an install is already broken by 0.7.6's own API removals.
dependencies=no longer type-checks for a non-Sequenceiterable (a generator, a set).Runtime is unaffected, there is no isinstance check; only type checkers will complain. Matches
what upstream did to the same kwarg.
addresson every channel. Additive: 0.7.5'sSubscriberSpec/PublisherSpechad no such field. Real queue names everywhere except amulti-queue subscriber, which gets the comma-joined string until AsyncAPI: emit one channel per queue, not one comma-joined channel per subscriber #181 lands.
__aiter__switching fromasync deftodefis not a break in practice: it raisedNotImplementedErrorbefore and raises it now, just from the call rather than the await, soawait sub.__aiter__()still behaves identically.Verification
Run locally against Postgres 17 via compose, so
test_integration.pywas not skipped.eof-fixer --check,ruff format --check,ruff check --no-fix,ty checkall cleanmkdocs build --strictcleanpython -m benchmarks check: gate OK