diff --git a/pyproject.toml b/pyproject.toml index f5dbb25..d56c363 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,7 +17,7 @@ classifiers = [ "Typing :: Typed", "Topic :: Software Development :: Libraries", ] -dependencies = ["flask>=3,<4", "modern-di>=3.1,<4"] +dependencies = ["flask>=3,<4", "modern-di>=4,<5"] version = "0" [project.urls] diff --git a/tests/conftest.py b/tests/conftest.py index ca59e40..4130d8a 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -16,6 +16,6 @@ def app() -> Flask: @pytest.fixture def container() -> typing.Iterator[Container]: - # caller owns opening the root container under modern-di 3.x's mandatory-open lifecycle + # caller owns opening the root container under modern-di's mandatory-open lifecycle with Container(groups=[Dependencies]) as container_: yield container_ diff --git a/tests/dependencies.py b/tests/dependencies.py index c2f9da1..a8b4ea0 100644 --- a/tests/dependencies.py +++ b/tests/dependencies.py @@ -14,11 +14,8 @@ class DependentCreator: dep1: SimpleCreator -def fetch_request_path(request: flask.Request | None = None) -> str: - # Optional-with-default so an explicit container.validate() treats the request - # as optional (the provider is only registered by setup_di); the real request - # still injects at runtime. - return request.path if request else "" +def fetch_request_path(request: flask.Request) -> str: + return request.path class Dependencies(Group):