Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions planning/releases/2.10.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# modern-di-fastapi 2.10.0 — adopt the modern-di integration kit

Maintenance release. **No public API change** — `setup_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`](https://github.com/modern-python/modern-di/blob/main/architecture/integration-kit.md),
shipped in
[modern-di 2.28.0](https://github.com/modern-python/modern-di/releases/tag/2.28.0).
This is the second of 13 planned adapter conversions across the `modern-di`
ecosystem (after
[`modern-di-starlette` 2.2.0](https://github.com/modern-python/modern-di-starlette/releases/tag/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.