Skip to content

2.10.0

Latest

Choose a tag to compare

@github-actions github-actions released this 13 Jul 12:19
c37a343

modern-di-fastapi 2.10.0 — adopt the modern-di integration kit

Maintenance release. No public API changesetup_di, 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.
This is the second of 13 planned adapter conversions across the modern-di
ecosystem (after
modern-di-starlette 2.2.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(request_container).
    FromDI now constructs
    Dependency(integrations.Marker(dependency)) — its own public signature
    (dependency, use_cache) is unchanged.
  • Unlike modern-di-starlette's conversion, this package is a native-DI
    adapter (FastAPI's own Depends drives resolution): no @inject decorator
    to replace, no parse_markers/resolve_markers usage, and no imports
    become dead.

Packaging

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

Downstream

No action needed — the public API (setup_di, FromDI, build_di_container,
fetch_di_container, fastapi_request_provider/fastapi_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.
  • architecture/container-lifecycle.md and architecture/dependency-resolution.md
    updated to describe the new internals.
  • Built via subagent-driven-development: 5 planned tasks, each with an
    independent spec+quality review; a whole-branch review before merge.