anydi 0.38.2rc1__py3-none-any.whl → 0.38.2rc2__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/_container.py CHANGED
@@ -547,7 +547,7 @@ class Container:
547
547
 
548
548
  async def aresolve(self, interface: type[T]) -> T:
549
549
  """Resolve an instance by interface asynchronously."""
550
- return await self._aresolve_or_acreate(interface, False)
550
+ return await self._aresolve_or_create(interface, False)
551
551
 
552
552
  def create(self, interface: type[T], /, **defaults: Any) -> T:
553
553
  """Create an instance by interface."""
@@ -555,7 +555,7 @@ class Container:
555
555
 
556
556
  async def acreate(self, interface: type[T], /, **defaults: Any) -> T:
557
557
  """Create an instance by interface asynchronously."""
558
- return await self._aresolve_or_acreate(interface, True, **defaults)
558
+ return await self._aresolve_or_create(interface, True, **defaults)
559
559
 
560
560
  def is_resolved(self, interface: AnyInterface) -> bool:
561
561
  """Check if an instance by interface exists."""
@@ -615,7 +615,7 @@ class Container:
615
615
 
616
616
  return cast(T, instance)
617
617
 
618
- async def _aresolve_or_acreate(
618
+ async def _aresolve_or_create(
619
619
  self, interface: type[T], create: bool, /, **defaults: Any
620
620
  ) -> T:
621
621
  """Internal method to handle instance resolution and creation asynchronously."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: anydi
3
- Version: 0.38.2rc1
3
+ Version: 0.38.2rc2
4
4
  Summary: Dependency Injection library
5
5
  Project-URL: Repository, https://github.com/antonrh/anydi
6
6
  Author-email: Anton Ruhlov <antonruhlov@gmail.com>
@@ -108,6 +108,8 @@ if __name__ == "__main__":
108
108
  *app.py*
109
109
 
110
110
  ```python
111
+ from typing import Annotated
112
+
111
113
  from fastapi import FastAPI
112
114
 
113
115
  import anydi.ext.fastapi
@@ -126,7 +128,7 @@ app = FastAPI()
126
128
 
127
129
 
128
130
  @app.get("/hello")
129
- def say_hello(message: str = Inject()) -> dict[str, str]:
131
+ def say_hello(message: Annotated[str, Inject()]) -> dict[str, str]:
130
132
  return {"message": message}
131
133
 
132
134
 
@@ -1,5 +1,5 @@
1
1
  anydi/__init__.py,sha256=aAq10a1V_zQ3_Me3p_pll5d1O77PIgqotkOm3pshORI,495
2
- anydi/_container.py,sha256=1reHespAhCYVs8_zOHJWwhoLoSrQhs9X5c51uRVm-Mw,42424
2
+ anydi/_container.py,sha256=wZ-_p0hehK7MBeHos7mi4TrZoPd1daeG52bcFmX4ZRA,42421
3
3
  anydi/_context.py,sha256=7LV_SL4QWkJeiG7_4D9PZ5lmU-MPzhofxC95zCgY9Gc,2651
4
4
  anydi/_types.py,sha256=S7scIdAzc2SyDUfEA4Knc89W6q-sdoGa3UBq-dqtq2c,3582
5
5
  anydi/_utils.py,sha256=OxePzLBD_mn3Ex2I93udoodlIARyKT3TLjXTFbZdmqw,4427
@@ -21,8 +21,8 @@ anydi/ext/django/ninja/_operation.py,sha256=wSWa7D73XTVlOibmOciv2l6JHPe1ERZcXrqI
21
21
  anydi/ext/django/ninja/_signature.py,sha256=2cSzKxBIxXLqtwNuH6GSlmjVJFftoGmleWfyk_NVEWw,2207
22
22
  anydi/ext/starlette/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
23
23
  anydi/ext/starlette/middleware.py,sha256=9CQtGg5ZzUz2gFSzJr8U4BWzwNjK8XMctm3n52M77Z0,792
24
- anydi-0.38.2rc1.dist-info/METADATA,sha256=1uaAnsVIgBRklI4VhtNU1PFIQacyBazRVqinXrF2ohc,4920
25
- anydi-0.38.2rc1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
26
- anydi-0.38.2rc1.dist-info/entry_points.txt,sha256=Nklo9f3Oe4AkNsEgC4g43nCJ-23QDngZSVDNRMdaILI,43
27
- anydi-0.38.2rc1.dist-info/licenses/LICENSE,sha256=V6rU8a8fv6o2jQ-7ODHs0XfDFimot8Q6Km6CylRIDTo,1069
28
- anydi-0.38.2rc1.dist-info/RECORD,,
24
+ anydi-0.38.2rc2.dist-info/METADATA,sha256=UD8qMBq6_YJvtH8NPApBZnBO0XXJzF1CmR3LXhvNHd0,4960
25
+ anydi-0.38.2rc2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
26
+ anydi-0.38.2rc2.dist-info/entry_points.txt,sha256=Nklo9f3Oe4AkNsEgC4g43nCJ-23QDngZSVDNRMdaILI,43
27
+ anydi-0.38.2rc2.dist-info/licenses/LICENSE,sha256=V6rU8a8fv6o2jQ-7ODHs0XfDFimot8Q6Km6CylRIDTo,1069
28
+ anydi-0.38.2rc2.dist-info/RECORD,,