Skip to content

Releases: modern-python/modern-di-fastapi

2.8.1

Choose a tag to compare

@github-actions github-actions released this 01 Jul 20:28
8efb24f

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_TOKEN secret. uv publish auto-detects the GitHub Actions id-token; the release job runs under a pypi environment that scopes the trusted publisher (#25).

Downstream

No action required. Nothing about the installed package changes.

2.8.0

Choose a tag to compare

@github-actions github-actions released this 26 Jun 19:44
50d9f71

modern-di-fastapi 2.8.0 — modern-di 2.21.0 floor + internal cleanups

Maintenance release. No public API changesetup_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.

2.7.3 — Reopen root container across lifespan cycles

Choose a tag to compare

@lesnik512 lesnik512 released this 16 Jun 14:19
2f036a6

Fix

  • Reopen the root container across lifespan cycles. _lifespan_manager now wraps the root container in async 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 raises ContainerClosedError on the first request. Requires modern-di>=2.19.0.

Also includes accumulated docs/CI housekeeping since 2.7.2.

2.7.2

Choose a tag to compare

@lesnik512 lesnik512 released this 13 Jun 10:12
cbef2e7

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

Choose a tag to compare

@lesnik512 lesnik512 released this 17 Mar 13:25
f335917

What's Changed

Full Changelog: 2.7.0...2.7.1

2.7.0

Choose a tag to compare

@lesnik512 lesnik512 released this 12 Feb 13:36
45ee1da

What's Changed

New Contributors

Full Changelog: https://github.com/modern-python/modern-di-fastapi/commits/2.7.0