From e6eed5733a7749fcf4d06e238dc502fa5070bfc1 Mon Sep 17 00:00:00 2001 From: Artur Shiriev Date: Mon, 13 Jul 2026 15:16:09 +0300 Subject: [PATCH] docs(release): add 2.10.0 notes (adopt the modern-di integration kit) Curated notes for the integration-kit conversion, matching this repo's 2.9.0 precedent for the same shape of change. --- planning/releases/2.10.0.md | 48 +++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 planning/releases/2.10.0.md diff --git a/planning/releases/2.10.0.md b/planning/releases/2.10.0.md new file mode 100644 index 0000000..f485f94 --- /dev/null +++ b/planning/releases/2.10.0.md @@ -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.