chore: migrate to faststream 0.7 (drop <0.7 support)#4
Merged
Conversation
Bumps the dependency from "faststream>=0.5,<0.7" to "faststream>=0.7,<0.8".
Drops the _OLD_MIDDLEWARES runtime version-sniff entirely — single code
path, no compat shim, no <0.7 support. The package's version="0"
pre-release posture allows the hard break.
Changes:
- pyproject.toml: pin "faststream>=0.7,<0.8".
- modern_di_faststream/main.py:
- Remove "from importlib.metadata import version".
- Remove _OLD_MIDDLEWARES sniff and its <0.6 branch in
_DiMiddleware.faststream_context.
- Collapse the if/else property pair into a single property
returning self.context.
Companion to:
planning/specs/2026-06-04-faststream-0.7-migration-design.md
planning/plans/2026-06-04-faststream-0.7-migration-pr2-plan.md
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
faststreamfrom>=0.5,<0.7(set by the companion PR1) to>=0.7,<0.8._OLD_MIDDLEWARESruntime version-sniff and its <0.6 branchin
_DiMiddleware. Single code path; no compat shim.from importlib.metadata import versionimport.The package's
version = "0"pre-release posture justifies the hardbreak on <0.7 support.
Design spec:
planning/specs/2026-06-04-faststream-0.7-migration-design.mdImplementation plan:
planning/plans/2026-06-04-faststream-0.7-migration-pr2-plan.mdTest plan
just lintclean on CI.just testgreen at 100% coverage on CI.tests/test_faststream_di.pypasses againstTestNatsBroker(theintegration path is the regression gate for the middleware
refactor).
python -c "from modern_di_faststream import FromDI, faststream_message_provider, fetch_di_container, setup_di"exits 0.🤖 Generated with Claude Code