Repository navigation
4.0: integration and app compatibility #579
Copy link
Copy link
Closed
Labels
enhancementNew feature or requestNew feature or requestready-for-humanRequires human implementationRequires human implementation
Milestone
Description
Activity
- addedenhancementNew feature or requestNew feature or requestready-for-humanRequires human implementationRequires human implementation
on Oct 4, 2026 This was generated by AI.
Done. modern-di 4.0.0 is on PyPI, and every integration and app now requires it.
- All 13 integrations are released as 4.0.0 on PyPI and pin
modern-di>=4,<5: aiogram, aiohttp, arq, celery, fastapi, faststream, flask, grpc, litestar, pytest, starlette, taskiq, typer. Each GitHub release starts with a Breaking note that links the migration guide. - modern-di-litestar needed build: skip multidict 7.1.0, which has no wheels for CPython 3.13+ modern-di-litestar#70 first:
multidict7.1.0 ships no wheels for CPython 3.13+ and no sdist, so the repo now skips that version through[tool.uv] constraint-dependencies. - fastapi-sqlalchemy-template (chore(deps): require modern-di-fastapi 4 fastapi-sqlalchemy-template#80) and litestar-sqlalchemy-template (chore(deps): require modern-di-litestar 4 litestar-sqlalchemy-template#58) needed only the pin bump. The optional
requestparameter falls back toNonesince feat: let a nullable or defaulted parameter fall back when its context value is unset (#601) #602, so Prepare for modern-di 4.0: optional request parameter in db routing fastapi-sqlalchemy-template#77 and Prepare for modern-di 4.0: optional request parameter in db routing litestar-sqlalchemy-template#56 closed without code changes. - chat-app (chore(deps): require modern-di 4 integrations chat-app#47) bumps
modern-di-litestarandmodern-di-pytest. fix: annotate test context managers with Generator for ty 0.0.85 chat-app#48 went in first to fix two ty 0.0.85 warnings on its test context managers, which had nothing to do with modern-di.
- All 13 integrations are released as 4.0.0 on PyPI and pin
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestready-for-humanRequires human implementationRequires human implementation
All 13 integrations were run against main (3.x baseline, then 4.0 main as a local wheel; pytest and ty).
Results
tests/test_lifespan.py:83uses the removedContainerClosedWarning(AttributeError, tyunresolved-attribute). Issue: Prepare for modern-di 4.0: rewrite test_restart_reopens_without_warning modern-di-arq#42app/resources/db.py:46usesrequest: Request | None = None; in 4.0test_db_routing.py::test_no_request_uses_primaryraisesContextValueNotSetError, the documented change. Issues: Prepare for modern-di 4.0: optional request parameter in db routing fastapi-sqlalchemy-template#77, Prepare for modern-di 4.0: optional request parameter in db routing litestar-sqlalchemy-template#56Checklist (after the 4.0 code issues land, re-run the compat check first)
container.providers_registry.find_providerwithcontainer.find_provider(added in feat!: tighten Container's public surface (#565) #592) atmodern_di_grpc/main.py:45andtests/test_inject.py:191.modern-di>=3,<4to<5and release: aiogram, aiohttp, arq, celery, fastapi, faststream, flask, grpc, litestar, pytest, starlette, taskiq, typer.docs/adr/0002-only-worker-lifecycle-is-wired.md:12mentionsContainerClosedWarning(prose).X | None = Nonecreator params in aiogram (dependencies.py:17), flask (:17), grpc (:26), taskiq (:17): comments describe 3.x optional semantics; reword.