File tree Expand file tree Collapse file tree 3 files changed +14
-2
lines changed
tests/unit/samples/wiringfastapi Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,12 @@ that were made in every particular version.
77From version 0.7.6 *Dependency Injector * framework strictly
88follows `Semantic versioning `_
99
10+ Development version
11+ -------------------
12+ - Hotfix a bug with importing FastAPI ``Request ``.
13+ See issue: `#398 <https://github.com/ets-labs/python-dependency-injector/issues/398 >`_.
14+ Thanks to `@tapm <https://github.com/tapm >`_ for reporting the bug.
15+
10164.23.0
1117------
1218- Add support of aliases for ``Configuration `` provider.
Original file line number Diff line number Diff line change @@ -345,8 +345,13 @@ def _unpatch(
345345def _fetch_reference_injections (
346346 fn : Callable [..., Any ],
347347) -> Tuple [Dict [str , Any ], Dict [str , Any ]]:
348- # # Hotfix, see: https://github.com/ets-labs/python-dependency-injector/issues/362
349- if GenericAlias and fn is GenericAlias :
348+ # Hotfix, see:
349+ # - https://github.com/ets-labs/python-dependency-injector/issues/362
350+ # - https://github.com/ets-labs/python-dependency-injector/issues/398
351+ if GenericAlias and any ((
352+ fn is GenericAlias ,
353+ getattr (fn , '__func__' , None ) is GenericAlias
354+ )):
350355 fn = fn .__init__
351356
352357 signature = inspect .signature (fn )
Original file line number Diff line number Diff line change 11import sys
22
33from fastapi import FastAPI , Depends
4+ from fastapi import Request # See: https://github.com/ets-labs/python-dependency-injector/issues/398
45from fastapi .security import HTTPBasic , HTTPBasicCredentials
56from dependency_injector import containers , providers
67from dependency_injector .wiring import inject , Provide
You can’t perform that action at this time.
0 commit comments