File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -76,8 +76,18 @@ def extract_marker_from_fastapi(param: Any) -> Any:
7676
7777 MARKER_EXTRACTORS .append (extract_marker_from_fastapi )
7878
79- with suppress (ImportError ):
80- from fast_depends .dependencies import Depends as FastDepends
79+ with suppress (ImportError ): # fast_depends >=3.0.0
80+ from fast_depends .dependencies .model import Dependant as FastDependant # type: ignore[attr-defined]
81+
82+ def extract_marker_from_dependant_fast_depends (param : Any ) -> Any :
83+ if isinstance (param , FastDependant ):
84+ return param .dependency
85+ return None
86+
87+ MARKER_EXTRACTORS .append (extract_marker_from_dependant_fast_depends )
88+
89+ with suppress (ImportError ): # fast_depends <3.0.0
90+ from fast_depends .dependencies import Depends as FastDepends # type: ignore[attr-defined]
8191
8292 def extract_marker_from_fast_depends (param : Any ) -> Any :
8393 if isinstance (param , FastDepends ):
You can’t perform that action at this time.
0 commit comments