Skip to content

chore: upgrade to modern-di 4 - #104

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 semvertag 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, and the rich floor from 10.11 to 13.8, which typer 0.26 requires. The floors job failed to resolve without them.
  • semvertag/__main__.py: _resolve_use_case declares a typer.Context parameter, and _tag_command passes ctx positionally. modern-di-typer 4's @inject adds a hidden _modern_di_typer_ctx parameter when the function has no typer.Context of its own. The old _resolve_use_case(ctx=ctx) call then failed with missing a required argument: '_modern_di_typer_ctx', which broke 32 CLI tests.

ioc.py needs no change. The ContextProvider(Settings) value is set in the callback before anything resolves it, which 4.x requires.

Testing

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

modern-di-typer 4's inject adds its own context parameter unless the
function declares a typer.Context, so the use-case helper now takes ctx.
modern-di-typer 4 needs typer>=0.26, which needs rich>=13.8.
@lesnik512
lesnik512 merged commit 81697d6 into main Oct 19, 2026
14 checks passed
@lesnik512
lesnik512 deleted the chore/modern-di-4 branch October 19, 2026 16:47
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