Skip to content

Adopt FastStream 0.7.6 - #209

Merged
lesnik512 merged 1 commit into
mainfrom
chore/faststream-0.7.6
Sep 21, 2026
Merged

lesnik512 merged 1 commit into
mainfrom
chore/faststream-0.7.6

Conversation

@lesnik512

Copy link
Copy Markdown
Member

What broke

FastStream 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: SubscriberSpec.__init__() missing 1 required positional argument: 'address' without the first of those. install locks with --upgrade and uv.lock is gitignored, so this is not a future problem: every CI run since 0.7.6 released resolves into it.

faststream~=0.7 was 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

  • Spec addresses. The subscriber trades its name override for channel_labels and passes address=; the publisher gains an address property and passes it through.
  • Test-broker registration. _test_broker_registry.py is deleted along with the try/except wrapping it in __init__.py. _get_broker_registry no longer exists, so the monkeypatch had already stopped registering TestStompBroker — the bare except Exception hid that, and nothing tested it. The declarative hook replaces it. Binding EnterType at the same time picks up the 0.7.1 TestBroker typing fix, so the __aenter__ cast override goes away, and create_publisher_fake_subscriber becomes an instance method to match the abstract base.
  • Narrowings. dependencies to Sequence across registrator/router/broker; __aiter__ to a plain def.
  • Tests. test_asyncapi_schema asserted 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-lowest job. 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 unbounded asgi-lifespan resolves to 0.0.1, whose sdist does not build.

Behaviour change

Dropping the subscriber's name override in favour of the base's _channel_key means title now 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}:Publisher unconditionally.

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 test against the Artemis and Classic containers (478 passed, 1 skipped), and just test-lowest on 3.11 at the floors (419 passed, faststream resolved to 0.7.6).

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.
@lesnik512
lesnik512 requested a review from vrslev September 21, 2026 13:27
@lesnik512
lesnik512 merged commit b20d283 into main Sep 21, 2026
7 checks passed
@lesnik512
lesnik512 deleted the chore/faststream-0.7.6 branch September 21, 2026 13:29
@vrslev

vrslev commented Sep 21, 2026

Copy link
Copy Markdown
Collaborator

Топ!

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.

2 participants