Skip to content

feat: support modern-di 4 - #42

Merged
lesnik512 merged 2 commits into
mainfrom
modern-di-4
Oct 9, 2026
Merged

lesnik512 merged 2 commits into
mainfrom
modern-di-4

Conversation

@lesnik512

Copy link
Copy Markdown
Member

Refs modern-python/modern-di#579.

Summary

  • Widen the requirement to modern-di>=3,<5.
  • tests/dependencies.py: fetch_event_type took event: TelegramObject | None = None, with a comment saying the default made container.validate() treat the event as optional. In 4.0 a registered ContextProvider with no value raises regardless of the creator default, and no test validates a container or resolves the helper outside an update. The parameter is now required and the comment is gone.

Verification

  • 3.x (modern-di 3.6.0 from PyPI): eof-fixer, ruff format/check and ty pass; pytest 20 passed, coverage 100%.
  • 4.0 (modern-di main f300c2e from a local wheel): ty passes; pytest 20 passed, coverage 100%.

This PR stays a draft until modern-di 4.0.0 is on PyPI.

Widen the requirement to modern-di>=3,<5. The fetch_event_type test helper drops its None default and the comment that described 3.x optional context.
@lesnik512
lesnik512 marked this pull request as ready for review October 9, 2026 18:00
@lesnik512
lesnik512 merged commit 72411eb into main Oct 9, 2026
12 checks passed
@lesnik512
lesnik512 deleted the modern-di-4 branch October 9, 2026 18:03
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