Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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>=3.1,<5"]
version = "0"

[project.urls]
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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_
7 changes: 2 additions & 5 deletions tests/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
Loading