Skip to content

chore(deps): require modern-di-fastapi 4 - #80

Merged
lesnik512 merged 1 commit into
mainfrom
modern-di-4-pin
Oct 9, 2026
Merged

lesnik512 merged 1 commit into
mainfrom
modern-di-4-pin

Conversation

@lesnik512

Copy link
Copy Markdown
Member

Closes #77. Part of modern-python/modern-di#579.

Summary

Bumps modern-di-fastapi to >=4,<5. The lock moves modern-di 3.5.0 to 4.0.0 and modern-di-fastapi 3.0.2 to 4.0.0; nothing else changes.

Design decisions

#77 expected choose_sa_engine(request: fastapi.Request | None = None) to raise ContextValueNotSetError outside a request under 4.0, and proposed an explicit ContextProvider(..., default=None). It was written before modern-python/modern-di#602, which makes a nullable or defaulted parameter fall back when its context value is unset. test_no_request_uses_primary passes unchanged, so no code change is needed.

Test plan

  • just test in Docker against Postgres: 31 passed, 100% coverage, with modern-di 4.0.0 and modern-di-fastapi 4.0.0 in the container
  • ruff, ty

@lesnik512
lesnik512 merged commit a0e425a into main Oct 9, 2026
2 checks passed
@lesnik512
lesnik512 deleted the modern-di-4-pin branch October 9, 2026 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prepare for modern-di 4.0: optional request parameter in db routing

1 participant