python-injection 0.12.1__tar.gz → 0.12.1.post0__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 (24) hide show
  1. {python_injection-0.12.1 → python_injection-0.12.1.post0}/PKG-INFO +1 -1
  2. {python_injection-0.12.1 → python_injection-0.12.1.post0}/injection/_core/module.py +15 -13
  3. {python_injection-0.12.1 → python_injection-0.12.1.post0}/pyproject.toml +1 -1
  4. {python_injection-0.12.1 → python_injection-0.12.1.post0}/README.md +0 -0
  5. {python_injection-0.12.1 → python_injection-0.12.1.post0}/injection/__init__.py +0 -0
  6. {python_injection-0.12.1 → python_injection-0.12.1.post0}/injection/__init__.pyi +0 -0
  7. {python_injection-0.12.1 → python_injection-0.12.1.post0}/injection/_core/__init__.py +0 -0
  8. {python_injection-0.12.1 → python_injection-0.12.1.post0}/injection/_core/common/__init__.py +0 -0
  9. {python_injection-0.12.1 → python_injection-0.12.1.post0}/injection/_core/common/asynchronous.py +0 -0
  10. {python_injection-0.12.1 → python_injection-0.12.1.post0}/injection/_core/common/event.py +0 -0
  11. {python_injection-0.12.1 → python_injection-0.12.1.post0}/injection/_core/common/invertible.py +0 -0
  12. {python_injection-0.12.1 → python_injection-0.12.1.post0}/injection/_core/common/lazy.py +0 -0
  13. {python_injection-0.12.1 → python_injection-0.12.1.post0}/injection/_core/common/threading.py +0 -0
  14. {python_injection-0.12.1 → python_injection-0.12.1.post0}/injection/_core/common/type.py +0 -0
  15. {python_injection-0.12.1 → python_injection-0.12.1.post0}/injection/_core/descriptors.py +0 -0
  16. {python_injection-0.12.1 → python_injection-0.12.1.post0}/injection/_core/hook.py +0 -0
  17. {python_injection-0.12.1 → python_injection-0.12.1.post0}/injection/_core/injectables.py +0 -0
  18. {python_injection-0.12.1 → python_injection-0.12.1.post0}/injection/exceptions.py +0 -0
  19. {python_injection-0.12.1 → python_injection-0.12.1.post0}/injection/integrations/__init__.py +0 -0
  20. {python_injection-0.12.1 → python_injection-0.12.1.post0}/injection/integrations/fastapi.py +0 -0
  21. {python_injection-0.12.1 → python_injection-0.12.1.post0}/injection/py.typed +0 -0
  22. {python_injection-0.12.1 → python_injection-0.12.1.post0}/injection/testing/__init__.py +0 -0
  23. {python_injection-0.12.1 → python_injection-0.12.1.post0}/injection/testing/__init__.pyi +0 -0
  24. {python_injection-0.12.1 → python_injection-0.12.1.post0}/injection/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: python-injection
3
- Version: 0.12.1
3
+ Version: 0.12.1.post0
4
4
  Summary: Fast and easy dependency injection framework.
5
5
  Home-page: https://github.com/100nm/python-injection
6
6
  License: MIT
@@ -208,18 +208,20 @@ class Updater[T]:
208
208
  return Record(injectable, self.mode)
209
209
 
210
210
 
211
- class LocatorHooks[T](NamedTuple):
212
- on_conflict: Hook[[Record[T], Record[T], InputType[T]], bool]
213
- on_input: Hook[[Iterable[InputType[T]]], Iterable[InputType[T]]]
214
- on_update: Hook[[Updater[T]], Updater[T]]
215
-
216
- @classmethod
217
- def default(cls) -> Self:
218
- return cls(
219
- on_conflict=Hook(),
220
- on_input=Hook(),
221
- on_update=Hook(),
222
- )
211
+ @dataclass(repr=False, eq=False, frozen=True, slots=True)
212
+ class LocatorHooks[T]:
213
+ on_conflict: Hook[[Record[T], Record[T], InputType[T]], bool] = field(
214
+ default_factory=Hook,
215
+ init=False,
216
+ )
217
+ on_input: Hook[[Iterable[InputType[T]]], Iterable[InputType[T]]] = field(
218
+ default_factory=Hook,
219
+ init=False,
220
+ )
221
+ on_update: Hook[[Updater[T]], Updater[T]] = field(
222
+ default_factory=Hook,
223
+ init=False,
224
+ )
223
225
 
224
226
 
225
227
  @dataclass(repr=False, frozen=True, slots=True)
@@ -233,7 +235,7 @@ class Locator(Broker):
233
235
  init=False,
234
236
  )
235
237
 
236
- static_hooks: ClassVar[LocatorHooks[Any]] = LocatorHooks.default()
238
+ static_hooks: ClassVar[LocatorHooks[Any]] = LocatorHooks()
237
239
 
238
240
  def __getitem__[T](self, cls: InputType[T], /) -> Injectable[T]:
239
241
  for input_class in self.__standardize_inputs((cls,)):
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "python-injection"
3
- version = "0.12.1"
3
+ version = "0.12.1.post0"
4
4
  description = "Fast and easy dependency injection framework."
5
5
  license = "MIT"
6
6
  readme = "README.md"