Adopt the modern-di integration kit#27
Merged
Merged
Conversation
…arkers in main.py
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'sFromDI/@injectalready hand-roll. This swaps the hand-rolled internals for kit calls. No public-API change; zero test-file changes.Seventh of 13 planned adapter conversions (after starlette 2.2.0, fastapi 2.10.0, litestar 2.13.0, aiohttp 2.2.0, flask 2.1.0, faststream 2.10.0). First conversion where the kit's Layer 1 (
bind/classify_connection) has nothing to attach to at all — a CLI invocation has no connection object analogous to a webRequestor brokerStreamMessage; the only per-invocation object is Click's owntyper.Context, which@injectalready threads through natively. This is a Layer-2-only conversion._FromDIdeleted;FromDI = integrations.from_di._parse_inject_paramskeeps its hand-rolledtyper.Context-detection scan (the kit has no equivalent for this typer-specific concern) but delegates marker-finding tointegrations.parse_markers._resolve_di_paramsdeleted;inject's wrapper callsintegrations.resolve_markersdirectly.dataclasses,providers(this repo has no module-level connection provider, unlike every prior web/broker conversion),T_co.architecture/injection.mdpromoted;architecture/scopes.mddeliberately left untouched (describes container hierarchy behaviorally, names none of the changed internals).modern-difloor to>=2.28.0,<3.Test plan
just test-ci— 100% line coverage, all 11 tests passing, zero test-file changesjust lint-ci— ruff, ty, check-planning all cleanreturntype hint, only reachable if a command were annotated-> typer.Context, which no real Typer command does)