python-injection 0.10.10__py3-none-any.whl → 0.10.12__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- injection/_core/module.py +5 -4
- injection/integrations/fastapi.py +3 -5
- {python_injection-0.10.10.dist-info → python_injection-0.10.12.dist-info}/METADATA +1 -1
- {python_injection-0.10.10.dist-info → python_injection-0.10.12.dist-info}/RECORD +5 -5
- {python_injection-0.10.10.dist-info → python_injection-0.10.12.dist-info}/WHEEL +0 -0
injection/_core/module.py
CHANGED
@@ -514,10 +514,11 @@ class Module(Broker, EventListener):
|
|
514
514
|
mode: Mode | ModeStr = Mode.get_default(),
|
515
515
|
):
|
516
516
|
def decorator(wp): # type: ignore[no-untyped-def]
|
517
|
-
|
518
|
-
self.
|
519
|
-
|
520
|
-
|
517
|
+
lazy_instance = Lazy(wp)
|
518
|
+
self.injectable(
|
519
|
+
lambda: ~lazy_instance,
|
520
|
+
inject=False,
|
521
|
+
on=(wp, on),
|
521
522
|
mode=mode,
|
522
523
|
)
|
523
524
|
return wp
|
@@ -1,6 +1,6 @@
|
|
1
1
|
from collections.abc import Callable
|
2
2
|
from types import GenericAlias
|
3
|
-
from typing import Any, ClassVar,
|
3
|
+
from typing import Any, ClassVar, TypeAliasType
|
4
4
|
|
5
5
|
from injection import Module, mod
|
6
6
|
from injection.exceptions import InjectionError
|
@@ -52,10 +52,8 @@ class InjectionDependency[T]:
|
|
52
52
|
return hash(self.__key)
|
53
53
|
|
54
54
|
@property
|
55
|
-
def __key(
|
56
|
-
self,
|
57
|
-
) -> tuple[type[Self], type[T] | TypeAliasType | GenericAlias, Module]:
|
58
|
-
return type(self), self.__class, self.__module
|
55
|
+
def __key(self) -> tuple[type[T] | TypeAliasType | GenericAlias, Module]:
|
56
|
+
return self.__class, self.__module
|
59
57
|
|
60
58
|
def __ensure(self, instance: T | Any) -> T:
|
61
59
|
if instance is self.__sentinel:
|
@@ -8,15 +8,15 @@ injection/_core/common/lazy.py,sha256=kCO1q4S6AdBhsP5RrihBJpgfeR4hxvMqSz1cpCgBdj
|
|
8
8
|
injection/_core/common/threading.py,sha256=OXm7L3p8c7O7eSkU-RTR7cobqIGMhuo-7gpDXsWKDNQ,214
|
9
9
|
injection/_core/common/type.py,sha256=TQTD-f_rnAHS0VgfkWxNFU8HAWPvkAktNDQ9_23JLHM,1705
|
10
10
|
injection/_core/hook.py,sha256=_TcwhF_DONfcoBz58RxVLeA950Rs8wtZSLGepZwGBRk,3009
|
11
|
-
injection/_core/module.py,sha256=
|
11
|
+
injection/_core/module.py,sha256=zvYqUIAV9saTYGBuKbR4tNk2AFrMxyFxNPmvMMmKoe4,25300
|
12
12
|
injection/exceptions.py,sha256=-5Shs7R5rctQXhpMLfcjiMBCzrtFWxC88qETUIHz57s,692
|
13
13
|
injection/integrations/__init__.py,sha256=NYLcstr4ESdLj326LlDub143z6JGM1z1pCOVWhBXK10,304
|
14
14
|
injection/integrations/blacksheep.py,sha256=yO5gLb_l4W3bNPFt-v2qWIL9R8PNon4JmOxQEHdi-5o,923
|
15
|
-
injection/integrations/fastapi.py,sha256=
|
15
|
+
injection/integrations/fastapi.py,sha256=GIxpSOumBQ8r8ihBVAzbp0nd68x8YWh6zSfL7d6QLWs,1786
|
16
16
|
injection/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
17
17
|
injection/testing/__init__.py,sha256=-C38gmZJwDtLDAWJhqiaosOZWQZwwFa1M34tODcrASs,747
|
18
18
|
injection/testing/__init__.pyi,sha256=6ZXbbS-9ppMdkxd03I6yBNurmR3Xw7sM_qiokibkLeY,386
|
19
19
|
injection/utils.py,sha256=gPcxGIdrGz4irbJXGTYPw33jNy8jg56u_c61eb1MBSE,1971
|
20
|
-
python_injection-0.10.
|
21
|
-
python_injection-0.10.
|
22
|
-
python_injection-0.10.
|
20
|
+
python_injection-0.10.12.dist-info/METADATA,sha256=Bna8FD7gCC_EOwwaP4TDD_WAC-cy2kBefAdmspEKxg0,3111
|
21
|
+
python_injection-0.10.12.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
22
|
+
python_injection-0.10.12.dist-info/RECORD,,
|
File without changes
|