Releases: modern-python/modern-di-litestar
2.10.0
modern-di-litestar 2.10.0 — autowire inherited providers
Fixes a KeyError when autowiring a Group that inherits providers, and
deepens the autowiring into a directly-testable internal module. Requires
modern-di>=2.20.0.
Fix
- Inherited providers are now autowired.
ModernDIPlugin(..., autowired_groups=[...])
raisedKeyErrorat app construction when a group inherited a provider from a
baseGroup: provider names were recovered from the subclass__dict__only,
while the provider list walked the full MRO. Names now come from
modern_di.Group.get_named_providers()(MRO-aware), so inherited providers are
registered under their declared attribute names like any other.
Internal refactors
_autowired_dependencies. The autowiring loop inon_app_initis replaced
by a module-level_autowired_dependencies(groups, *, existing)that returns
the name→Providemapping and owns duplicate-name detection. No public-API or
behavior change beyond the fix: theUserWarningmessage, its attribution
frame, last-write-wins overwrite, and both collision classes (group-vs-group
and group-vs-already-registered) are preserved.
Packaging
modern-di>=2.20.0,<3(was>=2.19.0). The fix consumes
Group.get_named_providers(), added inmodern-di2.20.0.
Upgrade
Bump modern-di-litestar to 2.10.0; pip/uv will pull modern-di>=2.20.0.
No code changes required. If you autowire groups that use inheritance, they now
work instead of raising at startup.
Internals
- 100% line coverage across Python 3.10–3.14;
ruffandtyclean. - Adopted the portable
lesnik512/planning-convention(1.0.0) —planning/
bundles and thearchitecture/truth-home; no runtime impact.
2.9.2 — Reopen root container across lifespan cycles
Fix
- Reopen the root container across lifespan cycles.
_lifespan_managernow wraps the root container inasync with, so it reopens on each startup and closes on shutdown. A second lifespan cycle against the same container (repeated test lifespans, server restarts) no longer raisesContainerClosedErroron the first request. Requiresmodern-di>=2.19.0.
Also includes accumulated docs/CI housekeeping since 2.9.1.
2.9.1
Require modern-di>=2.16.1, which fixes a clean-install ModuleNotFoundError: No module named 'typing_extensions' (modern-di's runtime import is now guarded under TYPE_CHECKING).
Also: docs link → modern-di.modern-python.org, CI alignment with modern-di.
🤖 Generated with Claude Code
2.9.0
What's Changed
- Migrate off deprecated Litestar Dependency API by @lesnik512 in #5
Full Changelog: 2.8.0...2.9.0
2.8.0
What's Changed
- add autowired_groups to ModernDIPlugin, expand docs and tests by @lesnik512 in #4
Full Changelog: 2.7.1...2.8.0
2.7.1
What's Changed
- migrate to ty by @lesnik512 in #2
- set bounds for packages by @lesnik512 in #3
Full Changelog: 2.7.0...2.7.1
2.7.0
What's Changed
- move to separate repo by @lesnik512 in #1
New Contributors
- @lesnik512 made their first contribution in #1
Full Changelog: https://github.com/modern-python/modern-di-litestar/commits/2.7.0