Skip to content

2.2.0

Latest

Choose a tag to compare

@github-actions github-actions released this 13 Jul 11:38
49fb691

modern-di-starlette 2.2.0 — adopt the modern-di integration kit

Internal refactor, no API change. Swaps this package's hand-rolled
connection-dispatch loop and FromDI/parse/resolve triad for the shared
primitives in modern_di.integrations,
shipped in
modern-di 2.28.0.
This is the first of 13 planned adapter conversions across the modern-di
ecosystem.

Internal

  • _DIMiddleware's isinstance-over-tuple connection dispatch is now
    integrations.classify_connection.
  • The child container's manual try/finally: await child_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.
  • _FromDI, _parse_inject_params, and _resolve_di_params are gone.
    FromDI is now a direct re-export (FromDI = integrations.from_di);
    inject calls integrations.parse_markers/integrations.resolve_markers.
  • architecture/container-lifecycle.md, architecture/dependency-resolution.md,
    and architecture/glossary.md updated to describe the new internals.

Packaging

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

Downstream

No action needed — the public API (setup_di, FromDI, @inject,
fetch_di_container, starlette_request_provider/starlette_websocket_provider)
is unchanged, and no test in this package's own suite needed to change.
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: 5 planned tasks, each with an
    independent spec+quality review; a whole-branch review before merge.