From 5103ff48577464abe50fa543fb8ea845a80a44e8 Mon Sep 17 00:00:00 2001 From: Artur Shiriev Date: Mon, 5 Oct 2026 18:11:27 +0300 Subject: [PATCH 1/2] feat: support modern-di 4 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. --- pyproject.toml | 2 +- tests/dependencies.py | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index ae9f8ae..ea981d7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,7 @@ dependencies = [ "pydantic>=2.12; python_version >= '3.14'", "aiohttp>=3.10.5; python_version == '3.13'", "aiohttp>=3.13; python_version >= '3.14'", - "modern-di>=3,<4", + "modern-di>=3,<5", ] version = "0" diff --git a/tests/dependencies.py b/tests/dependencies.py index 1f2401b..a76a7f3 100644 --- a/tests/dependencies.py +++ b/tests/dependencies.py @@ -14,11 +14,8 @@ class DependentCreator: dep1: SimpleCreator -def fetch_event_type(event: TelegramObject | None = None) -> str: - # Optional-with-default so an explicit container.validate() treats the event - # as optional (the providers are only registered by setup_di); the real - # event still injects at runtime. - return type(event).__name__ if event else "" +def fetch_event_type(event: TelegramObject) -> str: + return type(event).__name__ class Dependencies(Group): From 1a2bbe46cbba10b921f4ab541d7632389b612838 Mon Sep 17 00:00:00 2001 From: Artur Shiriev Date: Fri, 9 Oct 2026 20:53:34 +0300 Subject: [PATCH 2/2] chore(deps): require modern-di 4 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index ea981d7..7abea59 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,7 @@ dependencies = [ "pydantic>=2.12; python_version >= '3.14'", "aiohttp>=3.10.5; python_version == '3.13'", "aiohttp>=3.13; python_version >= '3.14'", - "modern-di>=3,<5", + "modern-di>=4,<5", ] version = "0"