Skip to content

2.13.0

Latest

Choose a tag to compare

@github-actions github-actions released this 13 Jul 12:56
0feefbf

modern-di-litestar 2.13.0 — adopt the modern-di integration kit

Maintenance release. No public API changeModernDIPlugin, FromDI,
build_di_container, fetch_di_container, and the context providers keep
their signatures and behavior. Swaps this package's hand-rolled connection
dispatch and marker resolution for the shared primitives in
modern_di.integrations,
shipped in
modern-di 2.28.0.
Third of 13 planned adapter conversions across the modern-di ecosystem
(after
modern-di-starlette 2.2.0
and
modern-di-fastapi 2.10.0).

Internal refactors

  • build_di_container's isinstance-over-tuple connection dispatch is now
    integrations.classify_connection.
  • The child container's manual try/finally: await container.close_async()
    is now Container's own async with
    — entering an already-open container
    is a no-op; exiting closes it, including on the exception path.
  • _Dependency's field changes from a raw dependency to
    marker: integrations.Marker[T_co]; __call__ becomes
    self.marker.resolve(di_container).
    FromDI now constructs
    Provide(dependency=_Dependency(integrations.Marker(dependency)), use_cache=False) — its own public signature (dependency) is unchanged.
  • Like modern-di-fastapi, this package is a native-DI adapter
    (Litestar's own Provide drives resolution): no @inject decorator to
    replace, no parse_markers/resolve_markers usage, and no imports
    become dead.
  • Internal test coverage: two tests that construct _Dependency directly
    (bypassing FromDI) now pass an integrations.Marker — required by the
    field rename above, verified to still exercise real resolution rather than
    a coincidentally-passing shortcut.

Packaging

  • Bumps the modern-di floor to >=2.28.0,<3.

Downstream

No action needed — the public API (ModernDIPlugin, FromDI,
build_di_container, fetch_di_container,
litestar_request_provider/litestar_websocket_provider) is unchanged.
Upgrading only requires modern-di>=2.28.0.

Internals

  • 100% line coverage; ruff, ty clean across Python 3.10–3.14.
  • Built via subagent-driven-development: 4 planned tasks, each with an
    independent spec+quality review; a whole-branch review before merge.