Adopt the modern-di integration kit#9
Merged
Conversation
Carries the design spec authored during the earlier planning session onto this branch so Task 5 can finalize it.
…arkers for FromDI and inject
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-di2.28.0 shippedmodern_di.integrations— framework-agnostic primitives that formalize what this package's_di_middlewareand@inject/FromDIalready hand-roll. This swaps the hand-rolled internals for kit calls. No public-API change; zero test-file changes.Fourth of 13 planned adapter conversions (after starlette 2.2.0, fastapi 2.10.0, litestar 2.13.0).
_di_middlewarekeeps its owncan_prepare()handshake probe to pick betweenaiohttp_websocket_provider/aiohttp_request_provider(aiohttp is a documented outlier: both providers bindweb.Request, soclassify_connection's isinstance dispatch can't tell a WebSocket upgrade from a plain request). Once the provider is picked,integrations.bind(provider, request)derives scope/context, wrapped inContainer'sasync withinstead of manualtry/finally: close_async()._FromDI/_parse_inject_params/_resolve_di_paramsdeleted;FromDI = integrations.from_di;injectnow composesintegrations.parse_markers/resolve_markers.enum,dataclasses,T_co) removed.container-lifecycle.md,dependency-resolution.md,glossary.md) promoted to describe the new internals.modern-difloor to>=2.28.0,<3.Test plan
just test-ci— 100% line coverage, all 10 tests passing, zero test-file changesjust lint-ci— ruff, ty, check-planning all clean