File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,7 @@ def extract_marker_from_fastapi(param: Any) -> Any:
7777 MARKER_EXTRACTORS .append (extract_marker_from_fastapi )
7878
7979with suppress (ImportError ):
80+ # fast-depends v2.x
8081 from fast_depends .dependencies import Depends as FastDepends
8182
8283 def extract_marker_from_fast_depends (param : Any ) -> Any :
@@ -86,6 +87,17 @@ def extract_marker_from_fast_depends(param: Any) -> Any:
8687
8788 MARKER_EXTRACTORS .append (extract_marker_from_fast_depends )
8889
90+ with suppress (ImportError ):
91+ # fast-depends v3.x (Depends() returns Dependant instances)
92+ from fast_depends .dependencies .model import Dependant as FastDependant
93+
94+ def extract_marker_from_fast_dependant (param : Any ) -> Any :
95+ if isinstance (param , FastDependant ):
96+ return param .dependency
97+ return None
98+
99+ MARKER_EXTRACTORS .append (extract_marker_from_fast_dependant )
100+
89101
90102with suppress (ImportError ):
91103 from starlette .requests import Request as StarletteRequest
You can’t perform that action at this time.
0 commit comments