Skip to content

Releases: modern-python/modern-di-litestar

2.10.0

26 Jun 08:54
355a8ca

Choose a tag to compare

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=[...])
    raised KeyError at app construction when a group inherited a provider from a
    base Group: 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 in on_app_init is replaced
    by a module-level _autowired_dependencies(groups, *, existing) that returns
    the name→Provide mapping and owns duplicate-name detection. No public-API or
    behavior change beyond the fix: the UserWarning message, 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 in modern-di 2.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; ruff and ty clean.
  • Adopted the portable lesnik512/planning-convention (1.0.0) — planning/
    bundles and the architecture/ truth-home; no runtime impact.

2.9.2 — Reopen root container across lifespan cycles

16 Jun 14:20
4c88ca8

Choose a tag to compare

Fix

  • Reopen the root container across lifespan cycles. _lifespan_manager now wraps the root container in async 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 raises ContainerClosedError on the first request. Requires modern-di>=2.19.0.

Also includes accumulated docs/CI housekeeping since 2.9.1.

2.9.1

13 Jun 10:12
0fd06a6

Choose a tag to compare

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

03 Jun 20:54
739a4ac

Choose a tag to compare

What's Changed

  • Migrate off deprecated Litestar Dependency API by @lesnik512 in #5

Full Changelog: 2.8.0...2.9.0

2.8.0

30 Apr 09:06
be86436

Choose a tag to compare

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

17 Mar 13:25
7405394

Choose a tag to compare

What's Changed

Full Changelog: 2.7.0...2.7.1

2.7.0

13 Feb 07:51
1a77c75

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: https://github.com/modern-python/modern-di-litestar/commits/2.7.0