Releases: modern-python/modern-di-fastapi
Release list
2.8.1
modern-di-fastapi 2.8.1 — release pipeline on PyPI Trusted Publishing
No library changes. The package is identical to 2.8.0; this release exercises the new publish path end-to-end.
CI
- Releases now authenticate to PyPI via Trusted Publishing (OIDC) instead of a long-lived
PYPI_TOKENsecret.uv publishauto-detects the GitHub Actions id-token; the release job runs under apypienvironment that scopes the trusted publisher (#25).
Downstream
No action required. Nothing about the installed package changes.
2.8.0
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_containerno longer re-states each connection type and context key in anisinstanceladder; it walks the registered context providers (_CONNECTION_PROVIDERS), taking eachcontext_typeandscopefrom the provider.setup_diregisters from the same tuple. Adding a connection kind is adding a provider — behavior is unchanged. - Own the lifespan composition.
setup_dipreviously chained its lifespan via the privatefastapi.routing._merge_lifespan_context. It now uses a small_compose_lifespanbuilt on the publicapp.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-difloor raised to>=2.21.0,<3(was>=2.19.0). The connection-mapping refactor relies on the publicContextProvider.context_typeadded 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, andeof-fixerclean. - Adopted the portable planning convention (
planning/) and seeded thearchitecture/truth home; releases are tag-driven.
2.7.3 — Reopen root container across lifespan cycles
Fix
- Reopen the root container across lifespan cycles.
_lifespan_managernow wraps the root container inasync with, so it reopens on each startup and closes on shutdown. A second lifespan cycle against the same container (repeated test lifespans, server restarts) no longer raisesContainerClosedErroron the first request. Requiresmodern-di>=2.19.0.
Also includes accumulated docs/CI housekeeping since 2.7.2.
2.7.2
Require modern-di>=2.16.1, which fixes a clean-install ModuleNotFoundError: No module named 'typing_extensions' (modern-di's runtime import is now guarded under TYPE_CHECKING).
Also: docs link → modern-di.modern-python.org, CI alignment with modern-di, dev-dep cleanup.
🤖 Generated with Claude Code
2.7.1
What's Changed
- migrate to ty by @lesnik512 in #2
- set upper bound for packages by @lesnik512 in #3
Full Changelog: 2.7.0...2.7.1
2.7.0
What's Changed
- move to separate repo by @lesnik512 in #1
New Contributors
- @lesnik512 made their first contribution in #1
Full Changelog: https://github.com/modern-python/modern-di-fastapi/commits/2.7.0