Repository navigation
Adopt FastStream 0.7.6 - #209
Merged
Merged
Conversation
0.7.6 made `address` a required field of `SubscriberSpec` and `PublisherSpec`, made `channel_labels` abstract, replaced the private ASGI try-it-out registry with a `TestBroker.__init_subclass__(broker=...)` hook, narrowed `dependencies` to `Sequence`, and turned `__aiter__` back into a plain `def`. AsyncAPI generation raises `TypeError` without the first of those, so `faststream~=0.7` is not a range this package supports: the floor moves to 0.7.6 and the cap to <0.8, which `~=0.7` did not express either. `_test_broker_registry.py` goes away. `_get_broker_registry` no longer exists, so the monkeypatch had already stopped registering `TestStompBroker` and the bare `except Exception` around it in `__init__.py` hid that. The declarative hook replaces it, and a test now covers the registration the monkeypatch never had. Binding `EnterType` at the same time picks up the 0.7.1 `TestBroker` typing fix, so the `__aenter__` cast override is no longer needed. Dropping the subscriber's `name` override in favour of the base's `_channel_key` is a behaviour change: `title` is public and documented but named only the operation, unlike every built-in broker. The publisher follows the same rule for symmetry. Channel keys are unchanged for anyone not passing a title. `test_asyncapi_schema` only asserted that generation did not raise, which is how `~=0.7` stayed green; it now asserts the channel keys and addresses. The new `test-lowest` job resolves `--resolution lowest-direct`: `install` locks with `--upgrade` and `uv.lock` is gitignored, so every existing job tests the top of the declared range and the floors ship unexercised. The dev harness needed a floor of its own first — an unbounded `asgi-lifespan` there resolves to 0.0.1, which does not build.
Collaborator
|
Топ! |
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.
What broke
FastStream 0.7.6 made
addressa required field ofSubscriberSpecandPublisherSpec, madechannel_labelsabstract, replaced the private ASGI try-it-out registry with aTestBroker.__init_subclass__(broker=...)hook, narroweddependenciestoSequence, and turned__aiter__back into a plaindef.AsyncAPI generation raises
TypeError: SubscriberSpec.__init__() missing 1 required positional argument: 'address'without the first of those.installlocks with--upgradeanduv.lockis gitignored, so this is not a future problem: every CI run since 0.7.6 released resolves into it.faststream~=0.7was never the range this package supports — it admits 0.8 as well. The floor moves to 0.7.6 (the hook below does not exist before it, so an older resolve fails at import rather than subtly) and the cap to<0.8.Changes
nameoverride forchannel_labelsand passesaddress=; the publisher gains anaddressproperty and passes it through._test_broker_registry.pyis deleted along with thetry/exceptwrapping it in__init__.py._get_broker_registryno longer exists, so the monkeypatch had already stopped registeringTestStompBroker— the bareexcept Exceptionhid that, and nothing tested it. The declarative hook replaces it. BindingEnterTypeat the same time picks up the 0.7.1TestBrokertyping fix, so the__aenter__cast override goes away, andcreate_publisher_fake_subscriberbecomes an instance method to match the abstract base.dependenciestoSequenceacross registrator/router/broker;__aiter__to a plaindef.test_asyncapi_schemaasserted only that generation did not raise, which is part of how this shipped; it now asserts the channel keys and addresses. Two new tests cover title-named channels and the registration the monkeypatch never had.test-lowestjob. Resolves--resolution lowest-direct. Every existing job tests the top of the declared range, so the floors ship unexercised — that is the gap this PR is fixing. The dev harness needed a floor of its own first: an unboundedasgi-lifespanresolves to 0.0.1, whose sdist does not build.Behaviour change
Dropping the subscriber's
nameoverride in favour of the base's_channel_keymeanstitlenow names the channel, not just the operation. It is public and documented, and every built-in broker already treats it this way. The publisher follows the same rule for symmetry — that half is optional and easy to drop if you would rather keep{address}:Publisherunconditionally.Channel keys are unchanged for anyone not passing a title.
Verification
All three new tests fail on the pre-fix tree and pass after.
just lint,just check-types(52 files),just test-fast(419 passed),just testagainst the Artemis and Classic containers (478 passed, 1 skipped), andjust test-loweston 3.11 at the floors (419 passed, faststream resolved to 0.7.6).