From 582086b3ac5e6c35fd9b3160699998c431abc242 Mon Sep 17 00:00:00 2001 From: Artur Shiriev Date: Mon, 19 Oct 2026 19:29:18 +0300 Subject: [PATCH 1/2] chore: upgrade to modern-di 4 via modern-di-typer 4 Closing a root container keeps overrides in modern-di 4, so the test that overrides settings now scopes the override with its handle. --- pyproject.toml | 2 +- tests/test_units.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 0c30870..9150792 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,7 +26,7 @@ dependencies = [ "pydantic>=2.8.2; python_version == '3.13'", "pydantic>=2.12; python_version >= '3.14'", "pydantic-settings>=2", - "modern-di-typer>=3,<4", + "modern-di-typer>=4,<5", "httpx2>=2", "httpware[pydantic]>=0.15.0", ] diff --git a/tests/test_units.py b/tests/test_units.py index e2a4e00..afb9930 100644 --- a/tests/test_units.py +++ b/tests/test_units.py @@ -152,8 +152,7 @@ def test_container_builds_a_real_client_from_settings() -> None: gitlab=GitLabConfig(endpoint="https://gitlab.test", token=pydantic.SecretStr("t")) ) - with ioc.container: - ioc.container.override(ioc.SettingsGroup.settings, settings) + with ioc.container, ioc.container.override(ioc.SettingsGroup.settings, settings): api: typing.Final = ioc.container.resolve(GitLabApi) assert isinstance(api.http, httpware.Client) From 9844ed42375ec5c13a6bb051fb4de1ccd3c70b1c Mon Sep 17 00:00:00 2001 From: Artur Shiriev Date: Mon, 19 Oct 2026 19:41:35 +0300 Subject: [PATCH 2/2] build: raise typer floor to 0.26 for modern-di-typer 4 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 9150792..0052f1f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,7 +19,7 @@ classifiers = [ ] version = "0" dependencies = [ - "typer>=0.13", + "typer>=0.26", # The first release whose pydantic-core ships a wheel for each interpreter. "pydantic>=2; python_version < '3.12'", "pydantic>=2.0.2; python_version == '3.12'",