chore: adopt modern-di 2.25 integration seams#22
Merged
Conversation
Replace the inline isinstance(AbstractProvider)/resolve dispatch in modern_di_fixture with container.resolve_dependency, the single provider-or-type entry point modern-di 2.25 added for integrations. Bump the modern-di floor to >=2.25,<3 accordingly. No providers_registry reach-in exists in this plugin, so add_providers does not apply here.
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
isinstance(AbstractProvider)dispatch inmodern_di_fixturewithcontainer.resolve_dependency(dependency)— the single provider-or-type entry point modern-di 2.25 added for integrations. Marker/branching semantics are identical; both code paths are already exercised bytests/test_modern_di_fixture.py.modern-didependency floor to>=2.25,<3inpyproject.toml(was>=2.16.1,<3).CLAUDE.mdarchitecture note to describe the delegation toresolve_dependency.add_providersdoes not apply to this repo: it never reaches intoproviders_registryto register providers post-construction (root or child), so there's no site to migrate.Related: modern-python/modern-di#283
Test plan
just install(env refreshed against modern-di 2.25.0)just test-ci— 16 passed, 100% coveragejust lint-ci— eof-fixer, ruff format, ruff check, ty check, planning index all clean