mirror of
				https://github.com/ets-labs/python-dependency-injector.git
				synced 2025-10-26 05:31:27 +03:00 
			
		
		
		
	support FastStreamDepends
This commit is contained in:
		
							parent
							
								
									46646b1acf
								
							
						
					
					
						commit
						a3fced441d
					
				|  | @ -54,6 +54,11 @@ try: | ||||||
| except ImportError: | except ImportError: | ||||||
|     werkzeug = None |     werkzeug = None | ||||||
| 
 | 
 | ||||||
|  | try: | ||||||
|  |     import fast_depends.dependencies | ||||||
|  | except ImportError: | ||||||
|  |     fast_depends = None | ||||||
|  | 
 | ||||||
| 
 | 
 | ||||||
| from . import providers | from . import providers | ||||||
| 
 | 
 | ||||||
|  | @ -686,8 +691,7 @@ def _get_patched( | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| def _is_fastapi_depends(param: Any) -> bool: | def _is_fastapi_depends(param: Any) -> bool: | ||||||
|     return fastapi and isinstance(param, fastapi.params.Depends) |     return (fastapi and isinstance(param, fastapi.params.Depends)) or (fast_depends and isinstance(param, fast_depends.dependencies.Depends)) | ||||||
| 
 |  | ||||||
| 
 | 
 | ||||||
| def _is_patched(fn) -> bool: | def _is_patched(fn) -> bool: | ||||||
|     return _patched_registry.has_callable(fn) |     return _patched_registry.has_callable(fn) | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user