anydi 0.27.0a6__py3-none-any.whl → 0.27.0a8__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
anydi/_types.py CHANGED
@@ -36,9 +36,9 @@ class Event:
36
36
  __slots__ = ()
37
37
 
38
38
 
39
- def is_event_type(cls: Any) -> bool:
39
+ def is_event_type(obj: Any) -> bool:
40
40
  """Checks if an object is an event type."""
41
- return issubclass(cls, Event)
41
+ return inspect.isclass(obj) and issubclass(obj, Event)
42
42
 
43
43
 
44
44
  @dataclass(frozen=True)
@@ -99,10 +99,6 @@ def _anydi_inject(
99
99
  if container.strict and not container.is_registered(interface):
100
100
  continue
101
101
 
102
- # Release the instance if it was already resolved
103
- if container.is_resolved(interface):
104
- container.release(interface)
105
-
106
102
  try:
107
103
  request.node.funcargs[argname] = container.resolve(interface)
108
104
  except Exception: # noqa
@@ -128,10 +124,6 @@ async def _anydi_ainject(
128
124
  if container.strict and not container.is_registered(interface):
129
125
  continue
130
126
 
131
- # Release the instance if it was already resolved
132
- if container.is_resolved(interface):
133
- container.release(interface)
134
-
135
127
  try:
136
128
  request.node.funcargs[argname] = await container.aresolve(interface)
137
129
  except Exception: # noqa
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: anydi
3
- Version: 0.27.0a6
3
+ Version: 0.27.0a8
4
4
  Summary: Dependency Injection library
5
5
  Home-page: https://github.com/antonrh/anydi
6
6
  License: MIT
@@ -4,7 +4,7 @@ anydi/_context.py,sha256=AVml53KyrQL4yyoJZkU2pbNzQwtg-1Jyt7m6R_0l6_8,11740
4
4
  anydi/_logger.py,sha256=UpubJUnW83kffFxkhUlObm2DmZX1Pjqoz9YFKS-JOPg,52
5
5
  anydi/_module.py,sha256=E1TfLud_Af-MPB83PxIzHVA1jlDW2FGaRP_il1a6y3Y,3675
6
6
  anydi/_scanner.py,sha256=cyEk-K2Q8ssZStq8GrxMeEcCuAZMw-RXrjlgWEevKCs,6667
7
- anydi/_types.py,sha256=YGfHVyysu2qNSXaZnvl_1BwPzKub84o3e3F4rK0tGQw,3628
7
+ anydi/_types.py,sha256=i8xFxz8pmFj7SGqwOwae_P9VtiRie6DVLwfaLibLwhc,3653
8
8
  anydi/_utils.py,sha256=zP4UvO1aVQJTB8pFNUWAcncvSiuhcg4xNdRU7CoLrqw,3871
9
9
  anydi/ext/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  anydi/ext/_utils.py,sha256=2kxLPTMM9Ro3s6-knbqYzONlqRB3hMcwZFFRQGHcFUg,2691
@@ -19,12 +19,12 @@ anydi/ext/django/ninja/_operation.py,sha256=wSWa7D73XTVlOibmOciv2l6JHPe1ERZcXrqI
19
19
  anydi/ext/django/ninja/_signature.py,sha256=2cSzKxBIxXLqtwNuH6GSlmjVJFftoGmleWfyk_NVEWw,2207
20
20
  anydi/ext/fastapi.py,sha256=vhfSyovXuCjvSkx6AiLOTNU975i8wDg72C5fqXQiFLw,2896
21
21
  anydi/ext/faststream.py,sha256=L4rkWYIO4ZZuWH-8M8NT6_J0bT0Dz_EWO3B6Oj1iFBI,2024
22
- anydi/ext/pytest_plugin.py,sha256=pFLcfxGtJfGSqtk7sPrrHFSKOaZoKZTWt5X8CT0ydmA,4242
22
+ anydi/ext/pytest_plugin.py,sha256=3OWphc4nEzla46_8KR7LXtwGns5eol_YlUWfTf4Cr2Q,3952
23
23
  anydi/ext/starlette/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
24
24
  anydi/ext/starlette/middleware.py,sha256=Ni0BQaPjs_Ha6zcLZYYJ3-XkslTCnL9aCSa06rnRDMI,1139
25
25
  anydi/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
26
- anydi-0.27.0a6.dist-info/LICENSE,sha256=V6rU8a8fv6o2jQ-7ODHs0XfDFimot8Q6Km6CylRIDTo,1069
27
- anydi-0.27.0a6.dist-info/METADATA,sha256=G95uZ9BoMP2BLlYVARh_BWIoArTZEeuEz-eJUBi9d5g,5163
28
- anydi-0.27.0a6.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
29
- anydi-0.27.0a6.dist-info/entry_points.txt,sha256=GmQblwzxFg42zva1HyBYJJ7TvrTIcSAGBHmyi3bvsi4,42
30
- anydi-0.27.0a6.dist-info/RECORD,,
26
+ anydi-0.27.0a8.dist-info/LICENSE,sha256=V6rU8a8fv6o2jQ-7ODHs0XfDFimot8Q6Km6CylRIDTo,1069
27
+ anydi-0.27.0a8.dist-info/METADATA,sha256=-yLzaxlmDc16XJOD6PfNlbXPvsbY3QmS-0b4yT1DYjE,5163
28
+ anydi-0.27.0a8.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
29
+ anydi-0.27.0a8.dist-info/entry_points.txt,sha256=GmQblwzxFg42zva1HyBYJJ7TvrTIcSAGBHmyi3bvsi4,42
30
+ anydi-0.27.0a8.dist-info/RECORD,,