From 7df26d1ac76aabf52f74ce75e5f908ccf28b4898 Mon Sep 17 00:00:00 2001 From: Okot Daniel Date: Mon, 11 Aug 2025 11:46:16 +0300 Subject: [PATCH 1/2] docs(declarative.rst): fix grammar in Declarative Container documentation (#916) fixes #915 --- docs/containers/declarative.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/containers/declarative.rst b/docs/containers/declarative.rst index febc0bf9..e464f49e 100644 --- a/docs/containers/declarative.rst +++ b/docs/containers/declarative.rst @@ -16,7 +16,7 @@ The declarative container providers should only be used when you have the contai Working with the providers of the container on the class level will influence all further instances. -The declarative container can not have any methods or any other attributes then providers. +A declarative container cannot have any methods or attributes other than providers. The container class provides next attributes: From 55d248862197b5796461fa210ea3cf185d5b6762 Mon Sep 17 00:00:00 2001 From: Brian Pugh Date: Thu, 4 Dec 2025 12:43:57 -0500 Subject: [PATCH 2/2] FastDepends v3 compatability. --- src/dependency_injector/wiring.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/dependency_injector/wiring.py b/src/dependency_injector/wiring.py index 211fdcde..98173570 100644 --- a/src/dependency_injector/wiring.py +++ b/src/dependency_injector/wiring.py @@ -77,6 +77,7 @@ def extract_marker_from_fastapi(param: Any) -> Any: MARKER_EXTRACTORS.append(extract_marker_from_fastapi) with suppress(ImportError): + # fast-depends v2.x from fast_depends.dependencies import Depends as FastDepends def extract_marker_from_fast_depends(param: Any) -> Any: @@ -86,6 +87,17 @@ def extract_marker_from_fast_depends(param: Any) -> Any: MARKER_EXTRACTORS.append(extract_marker_from_fast_depends) +with suppress(ImportError): + # fast-depends v3.x (Depends() returns Dependant instances) + from fast_depends.dependencies.model import Dependant as FastDependant + + def extract_marker_from_fast_dependant(param: Any) -> Any: + if isinstance(param, FastDependant): + return param.dependency + return None + + MARKER_EXTRACTORS.append(extract_marker_from_fast_dependant) + with suppress(ImportError): from starlette.requests import Request as StarletteRequest