Skip to content

feat: support modern-di 4 - #38

Draft
lesnik512 wants to merge 1 commit into
mainfrom
modern-di-4
Draft

lesnik512 wants to merge 1 commit 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.1,<5.
  • tests/dependencies.py: fetch_request_path took request: flask.Request | None = None, with a comment saying the default made container.validate() treat the request as optional. In 4.0 a registered ContextProvider with no value raises regardless of the creator default, and the only test that resolves the helper does so inside a request. The parameter is now required and the comment is gone.
  • tests/conftest.py: the fixture comment named the open lifecycle as a 3.x rule. 4.0 keeps it, so the comment no longer names a version.

Verification

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

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

Widen the requirement to modern-di>=3.1,<5. The fetch_request_path test helper drops its None default and the comment that described 3.x optional context.

This branch has not been deployed

No deployments
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