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.
7
7
From version 0.7.6 *Dependency Injector * framework strictly
8
8
follows `Semantic versioning `_
9
9
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
+
10
16
4.23.0
11
17
------
12
18
- Add support of aliases for ``Configuration `` provider.
Original file line number Diff line number Diff line change @@ -345,8 +345,13 @@ def _unpatch(
345
345
def _fetch_reference_injections (
346
346
fn : Callable [..., Any ],
347
347
) -> 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
+ )):
350
355
fn = fn .__init__
351
356
352
357
signature = inspect .signature (fn )
Original file line number Diff line number Diff line change 1
1
import sys
2
2
3
3
from fastapi import FastAPI , Depends
4
+ from fastapi import Request # See: https://github.com/ets-labs/python-dependency-injector/issues/398
4
5
from fastapi .security import HTTPBasic , HTTPBasicCredentials
5
6
from dependency_injector import containers , providers
6
7
from dependency_injector .wiring import inject , Provide
You can’t perform that action at this time.
0 commit comments