Adopt the modern-di integration kit#3
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.Tenth 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, typer 2.3.0, grpc 2.1.0, celery 2.1.0). Like typer/celery, arq has no connection/context object — its per-job
ctxis a baredict— so this is a Layer-2-only conversion. Unlike celery, arq has no double-wrap guard either:injectisn't swept, and the existing_WRAPPED_MARKERprotects a different concern (a secondsetup_dicall), left untouched._FromDIdeleted;FromDI = integrations.from_di.injectcallsintegrations.parse_markersdirectly (_parse_inject_paramsdeleted entirely — its body was an exact duplicate); resolves viaintegrations.resolve_markers(child, di_params).*args/**kwargsdecoration-timeTypeErrorguard, by-name signature binding,functools.wraps, and theasync def wrappershape) is preserved exactly unchanged.dataclasses,providers,T_co.setup_diand all four lifecycle-hook wrappers are untouched.architecture/dependency-injection.mdpromoted to describe the new internals.modern-difloor to>=2.28,<3.Test plan
just test-ci— 100% line coverage, all 14 tests passing, zero test-file changesjust lint-ci— ruff, ty, check-planning all clean