anydi 0.38.2rc1__tar.gz → 0.39.0__tar.gz

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.
Files changed (87) hide show
  1. {anydi-0.38.2rc1 → anydi-0.39.0}/PKG-INFO +4 -2
  2. {anydi-0.38.2rc1 → anydi-0.39.0}/README.md +3 -1
  3. {anydi-0.38.2rc1 → anydi-0.39.0}/anydi/_container.py +3 -3
  4. {anydi-0.38.2rc1 → anydi-0.39.0}/docs/index.md +3 -1
  5. {anydi-0.38.2rc1 → anydi-0.39.0}/docs/usage.md +1 -1
  6. {anydi-0.38.2rc1 → anydi-0.39.0}/pyproject.toml +2 -2
  7. {anydi-0.38.2rc1 → anydi-0.39.0}/uv.lock +1 -1
  8. {anydi-0.38.2rc1 → anydi-0.39.0}/.editorconfig +0 -0
  9. {anydi-0.38.2rc1 → anydi-0.39.0}/.github/workflows/ci.yml +0 -0
  10. {anydi-0.38.2rc1 → anydi-0.39.0}/.gitignore +0 -0
  11. {anydi-0.38.2rc1 → anydi-0.39.0}/.readthedocs.yaml +0 -0
  12. {anydi-0.38.2rc1 → anydi-0.39.0}/LICENSE +0 -0
  13. {anydi-0.38.2rc1 → anydi-0.39.0}/Makefile +0 -0
  14. {anydi-0.38.2rc1 → anydi-0.39.0}/anydi/__init__.py +0 -0
  15. {anydi-0.38.2rc1 → anydi-0.39.0}/anydi/_context.py +0 -0
  16. {anydi-0.38.2rc1 → anydi-0.39.0}/anydi/_types.py +0 -0
  17. {anydi-0.38.2rc1 → anydi-0.39.0}/anydi/_utils.py +0 -0
  18. {anydi-0.38.2rc1 → anydi-0.39.0}/anydi/ext/__init__.py +0 -0
  19. {anydi-0.38.2rc1 → anydi-0.39.0}/anydi/ext/_utils.py +0 -0
  20. {anydi-0.38.2rc1 → anydi-0.39.0}/anydi/ext/django/__init__.py +0 -0
  21. {anydi-0.38.2rc1 → anydi-0.39.0}/anydi/ext/django/_container.py +0 -0
  22. {anydi-0.38.2rc1 → anydi-0.39.0}/anydi/ext/django/_settings.py +0 -0
  23. {anydi-0.38.2rc1 → anydi-0.39.0}/anydi/ext/django/_utils.py +0 -0
  24. {anydi-0.38.2rc1 → anydi-0.39.0}/anydi/ext/django/apps.py +0 -0
  25. {anydi-0.38.2rc1 → anydi-0.39.0}/anydi/ext/django/middleware.py +0 -0
  26. {anydi-0.38.2rc1 → anydi-0.39.0}/anydi/ext/django/ninja/__init__.py +0 -0
  27. {anydi-0.38.2rc1 → anydi-0.39.0}/anydi/ext/django/ninja/_operation.py +0 -0
  28. {anydi-0.38.2rc1 → anydi-0.39.0}/anydi/ext/django/ninja/_signature.py +0 -0
  29. {anydi-0.38.2rc1 → anydi-0.39.0}/anydi/ext/fastapi.py +0 -0
  30. {anydi-0.38.2rc1 → anydi-0.39.0}/anydi/ext/faststream.py +0 -0
  31. {anydi-0.38.2rc1 → anydi-0.39.0}/anydi/ext/pydantic_settings.py +0 -0
  32. {anydi-0.38.2rc1 → anydi-0.39.0}/anydi/ext/pytest_plugin.py +0 -0
  33. {anydi-0.38.2rc1 → anydi-0.39.0}/anydi/ext/starlette/__init__.py +0 -0
  34. {anydi-0.38.2rc1 → anydi-0.39.0}/anydi/ext/starlette/middleware.py +0 -0
  35. {anydi-0.38.2rc1 → anydi-0.39.0}/anydi/py.typed +0 -0
  36. {anydi-0.38.2rc1 → anydi-0.39.0}/docs/examples/basic.md +0 -0
  37. {anydi-0.38.2rc1 → anydi-0.39.0}/docs/extensions/django.md +0 -0
  38. {anydi-0.38.2rc1 → anydi-0.39.0}/docs/extensions/fastapi.md +0 -0
  39. {anydi-0.38.2rc1 → anydi-0.39.0}/docs/extensions/faststream.md +0 -0
  40. {anydi-0.38.2rc1 → anydi-0.39.0}/docs/extensions/pydantic_settings.md +0 -0
  41. {anydi-0.38.2rc1 → anydi-0.39.0}/mkdocs.yml +0 -0
  42. {anydi-0.38.2rc1 → anydi-0.39.0}/tests/__init__.py +0 -0
  43. {anydi-0.38.2rc1 → anydi-0.39.0}/tests/conftest.py +0 -0
  44. {anydi-0.38.2rc1 → anydi-0.39.0}/tests/ext/__init__.py +0 -0
  45. {anydi-0.38.2rc1 → anydi-0.39.0}/tests/ext/django/__init__.py +0 -0
  46. {anydi-0.38.2rc1 → anydi-0.39.0}/tests/ext/django/api/__init__.py +0 -0
  47. {anydi-0.38.2rc1 → anydi-0.39.0}/tests/ext/django/api/router.py +0 -0
  48. {anydi-0.38.2rc1 → anydi-0.39.0}/tests/ext/django/api/test_router.py +0 -0
  49. {anydi-0.38.2rc1 → anydi-0.39.0}/tests/ext/django/api/urls.py +0 -0
  50. {anydi-0.38.2rc1 → anydi-0.39.0}/tests/ext/django/conftest.py +0 -0
  51. {anydi-0.38.2rc1 → anydi-0.39.0}/tests/ext/django/container.py +0 -0
  52. {anydi-0.38.2rc1 → anydi-0.39.0}/tests/ext/django/scan/__init__.py +0 -0
  53. {anydi-0.38.2rc1 → anydi-0.39.0}/tests/ext/django/services.py +0 -0
  54. {anydi-0.38.2rc1 → anydi-0.39.0}/tests/ext/django/settings.py +0 -0
  55. {anydi-0.38.2rc1 → anydi-0.39.0}/tests/ext/django/test_views.py +0 -0
  56. {anydi-0.38.2rc1 → anydi-0.39.0}/tests/ext/django/urls.py +0 -0
  57. {anydi-0.38.2rc1 → anydi-0.39.0}/tests/ext/django/views.py +0 -0
  58. {anydi-0.38.2rc1 → anydi-0.39.0}/tests/ext/fastapi/__init__.py +0 -0
  59. {anydi-0.38.2rc1 → anydi-0.39.0}/tests/ext/fastapi/app.py +0 -0
  60. {anydi-0.38.2rc1 → anydi-0.39.0}/tests/ext/fastapi/conftest.py +0 -0
  61. {anydi-0.38.2rc1 → anydi-0.39.0}/tests/ext/fastapi/test_auto_register.py +0 -0
  62. {anydi-0.38.2rc1 → anydi-0.39.0}/tests/ext/fastapi/test_ext.py +0 -0
  63. {anydi-0.38.2rc1 → anydi-0.39.0}/tests/ext/fastapi/test_routes.py +0 -0
  64. {anydi-0.38.2rc1 → anydi-0.39.0}/tests/ext/faststream/__init__.py +0 -0
  65. {anydi-0.38.2rc1 → anydi-0.39.0}/tests/ext/faststream/test_ext.py +0 -0
  66. {anydi-0.38.2rc1 → anydi-0.39.0}/tests/ext/faststream/test_subscribers.py +0 -0
  67. {anydi-0.38.2rc1 → anydi-0.39.0}/tests/ext/fixtures.py +0 -0
  68. {anydi-0.38.2rc1 → anydi-0.39.0}/tests/ext/starlette/__init__.py +0 -0
  69. {anydi-0.38.2rc1 → anydi-0.39.0}/tests/ext/starlette/app.py +0 -0
  70. {anydi-0.38.2rc1 → anydi-0.39.0}/tests/ext/starlette/conftest.py +0 -0
  71. {anydi-0.38.2rc1 → anydi-0.39.0}/tests/ext/starlette/test_routes.py +0 -0
  72. {anydi-0.38.2rc1 → anydi-0.39.0}/tests/ext/test_pydantic.py +0 -0
  73. {anydi-0.38.2rc1 → anydi-0.39.0}/tests/ext/test_pytest_plugin.py +0 -0
  74. {anydi-0.38.2rc1 → anydi-0.39.0}/tests/fixtures.py +0 -0
  75. {anydi-0.38.2rc1 → anydi-0.39.0}/tests/scan_app/__init__.py +0 -0
  76. {anydi-0.38.2rc1 → anydi-0.39.0}/tests/scan_app/a/__init__.py +0 -0
  77. {anydi-0.38.2rc1 → anydi-0.39.0}/tests/scan_app/a/a1/__init__.py +0 -0
  78. {anydi-0.38.2rc1 → anydi-0.39.0}/tests/scan_app/a/a1/handlers.py +0 -0
  79. {anydi-0.38.2rc1 → anydi-0.39.0}/tests/scan_app/a/a2/__init__.py +0 -0
  80. {anydi-0.38.2rc1 → anydi-0.39.0}/tests/scan_app/a/a2/a21/__init__.py +0 -0
  81. {anydi-0.38.2rc1 → anydi-0.39.0}/tests/scan_app/a/a2/a21/handlers.py +0 -0
  82. {anydi-0.38.2rc1 → anydi-0.39.0}/tests/scan_app/a/a3/__init__.py +0 -0
  83. {anydi-0.38.2rc1 → anydi-0.39.0}/tests/scan_app/a/a3/handlers.py +0 -0
  84. {anydi-0.38.2rc1 → anydi-0.39.0}/tests/scan_app/b/__init__.py +0 -0
  85. {anydi-0.38.2rc1 → anydi-0.39.0}/tests/scan_app/b/handlers.py +0 -0
  86. {anydi-0.38.2rc1 → anydi-0.39.0}/tests/test_container.py +0 -0
  87. {anydi-0.38.2rc1 → anydi-0.39.0}/tests/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: anydi
3
- Version: 0.38.2rc1
3
+ Version: 0.39.0
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
 
@@ -73,6 +73,8 @@ if __name__ == "__main__":
73
73
  *app.py*
74
74
 
75
75
  ```python
76
+ from typing import Annotated
77
+
76
78
  from fastapi import FastAPI
77
79
 
78
80
  import anydi.ext.fastapi
@@ -91,7 +93,7 @@ app = FastAPI()
91
93
 
92
94
 
93
95
  @app.get("/hello")
94
- def say_hello(message: str = Inject()) -> dict[str, str]:
96
+ def say_hello(message: Annotated[str, Inject()]) -> dict[str, str]:
95
97
  return {"message": message}
96
98
 
97
99
 
@@ -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."""
@@ -70,6 +70,8 @@ if __name__ == "__main__":
70
70
  *app.py*
71
71
 
72
72
  ```python
73
+ from typing import Annotated
74
+
73
75
  from fastapi import FastAPI
74
76
 
75
77
  import anydi.ext.fastapi
@@ -88,7 +90,7 @@ app = FastAPI()
88
90
 
89
91
 
90
92
  @app.get("/hello")
91
- def say_hello(message: str = Inject()) -> dict[str, str]:
93
+ def say_hello(message: Annotated[str, Inject()]) -> dict[str, str]:
92
94
  return {"message": message}
93
95
 
94
96
 
@@ -570,7 +570,7 @@ def service() -> Service:
570
570
  return Service(name="demo")
571
571
 
572
572
 
573
- @container.injectable
573
+ @container.inject
574
574
  def handler(service: Service = auto) -> None:
575
575
  print(f"Hello, from service `{service.name}`")
576
576
  ```
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "anydi"
3
- version = "0.38.2-rc1"
3
+ version = "0.39.0"
4
4
  description = "Dependency Injection library"
5
5
  authors = [{ name = "Anton Ruhlov", email = "antonruhlov@gmail.com" }]
6
6
  requires-python = "~=3.9"
@@ -136,7 +136,7 @@ omit = [
136
136
  ]
137
137
 
138
138
  [tool.bumpversion]
139
- current_version = "0.38.2-rc1"
139
+ current_version = "0.39.0"
140
140
  parse = """(?x)
141
141
  (?P<major>0|[1-9]\\d*)\\.
142
142
  (?P<minor>0|[1-9]\\d*)\\.
@@ -12,7 +12,7 @@ wheels = [
12
12
 
13
13
  [[package]]
14
14
  name = "anydi"
15
- version = "0.38.2rc0"
15
+ version = "0.39.0"
16
16
  source = { editable = "." }
17
17
  dependencies = [
18
18
  { name = "anyio" },
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes