Adopt the modern-di integration kit#8
Merged
Conversation
…ync-with in _DIMiddleware
…arkers for FromDI and inject
Carries the design spec authored during the earlier planning session onto this branch so Task 5 can finalize it.
This was referenced Jul 13, 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.
Summary
modern_di.integrations(shipped inmodern-di2.28.0) instead of hand-rolling the same logic — zero change to public API or test behavior._DIMiddleware's isinstance-over-tuple connection dispatch is replaced byintegrations.classify_connection; the manualtry/finallyaround the child container is replaced byContainer's ownasync withprotocol._FromDI/_parse_inject_params/_resolve_di_paramsare deleted;FromDIbecomes a direct re-export ofintegrations.from_di;injectcomposesintegrations.parse_markers/resolve_markers.pyproject.toml'smodern-difloor bumped to>=2.28.0,<3.architecture/container-lifecycle.md,architecture/dependency-resolution.md, andarchitecture/glossary.mdpromoted to describe the new internals.Design background:
planning/changes/2026-07-13.01-adopt-integration-kit.md. This is the first of 13 planned adapter conversions across themodern-diecosystem (starlette chosen first, permodern-di's own rollout plan, as the richest non-native-DI example).Test plan
just test-ci— 8 passed, 100% line coveragejust lint-ci— ruff format/check,ty check,check-planningall clean