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
22 changes: 22 additions & 0 deletions planning/releases/2.8.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# modern-di-fastapi 2.8.0 — modern-di 2.21.0 floor + internal cleanups

Maintenance release. **No public API change** — `setup_di`, `FromDI`, `build_di_container`, and the context providers keep their signatures and behavior. It raises the `modern-di` floor and cleans up two internals.

## Internal refactors

- **Connection-kind mapping single-sourced off the context providers.** `build_di_container` no longer re-states each connection type and context key in an `isinstance` ladder; it walks the registered context providers (`_CONNECTION_PROVIDERS`), taking each `context_type` and `scope` from the provider. `setup_di` registers from the same tuple. Adding a connection kind is adding a provider — behavior is unchanged.
- **Own the lifespan composition.** `setup_di` previously chained its lifespan via the private `fastapi.routing._merge_lifespan_context`. It now uses a small `_compose_lifespan` built on the public `app.router.lifespan_context`, dropping the FastAPI-internals dependency. The original lifespan stays the outer context, its startup/shutdown and yielded state pass through, and the root container still reopens across lifespan cycles.

## Packaging

- **`modern-di` floor raised to `>=2.21.0,<3`** (was `>=2.19.0`). The connection-mapping refactor relies on the public `ContextProvider.context_type` added in modern-di 2.21.0.
- Enriched PyPI metadata (keywords, classifiers, project URLs).

## Downstream

Requires **`modern-di>=2.21.0`**. There is no API change, so application code that uses `setup_di` / `FromDI` needs no edits — only the `modern-di` floor moves.

## Internals

- 100% line coverage maintained; `ruff`, `ty`, and `eof-fixer` clean.
- Adopted the portable planning convention (`planning/`) and seeded the `architecture/` truth home; releases are tag-driven.