Skip to content

chore: upgrade to modern-di 4 - #45

Merged
lesnik512 merged 2 commits into
mainfrom
chore/modern-di-4
Oct 19, 2026
Merged

lesnik512 merged 2 commits into
mainfrom
chore/modern-di-4

Conversation

@lesnik512

@lesnik512 lesnik512 commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Moves release-scope from modern-di 3 to 4 by bumping modern-di-typer to >=4,<5. The lock resolves modern-di 4.3.0 and modern-di-typer 4.0.3.

Changes

  • pyproject.toml: modern-di-typer>=4,<5.
  • pyproject.toml: the typer floor goes from 0.13 to 0.26, which modern-di-typer 4 requires. The floors job failed to resolve without it.
  • tests/test_units.py: test_container_builds_a_real_client_from_settings now uses the override handle as a context manager. In modern-di 4, closing a root container keeps its overrides (migration guide). Without the handle, every later test resolved the overridden settings and called https://gitlab.test.

The app code needs no change: ioc.py uses Factory(cache=True) and CacheSettings(finalizer=...), both still valid in 4.x.

Testing

The floors job (lowest direct versions) passes locally on 3.11 and 3.14. just test-ci: 140 passed, 100% coverage. just test-smoke: 16 passed. just lint is clean.

Closing a root container keeps overrides in modern-di 4, so the test
that overrides settings now scopes the override with its handle.
@lesnik512
lesnik512 merged commit 922f070 into main Oct 19, 2026
13 checks passed
@lesnik512
lesnik512 deleted the chore/modern-di-4 branch October 19, 2026 16:50
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.

1 participant