python-injection 0.10.10__tar.gz → 0.10.11__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (22) hide show
  1. {python_injection-0.10.10 → python_injection-0.10.11}/PKG-INFO +1 -1
  2. {python_injection-0.10.10 → python_injection-0.10.11}/injection/_core/module.py +4 -3
  3. {python_injection-0.10.10 → python_injection-0.10.11}/injection/integrations/fastapi.py +3 -5
  4. {python_injection-0.10.10 → python_injection-0.10.11}/pyproject.toml +1 -1
  5. {python_injection-0.10.10 → python_injection-0.10.11}/README.md +0 -0
  6. {python_injection-0.10.10 → python_injection-0.10.11}/injection/__init__.py +0 -0
  7. {python_injection-0.10.10 → python_injection-0.10.11}/injection/__init__.pyi +0 -0
  8. {python_injection-0.10.10 → python_injection-0.10.11}/injection/_core/__init__.py +0 -0
  9. {python_injection-0.10.10 → python_injection-0.10.11}/injection/_core/common/__init__.py +0 -0
  10. {python_injection-0.10.10 → python_injection-0.10.11}/injection/_core/common/event.py +0 -0
  11. {python_injection-0.10.10 → python_injection-0.10.11}/injection/_core/common/invertible.py +0 -0
  12. {python_injection-0.10.10 → python_injection-0.10.11}/injection/_core/common/lazy.py +0 -0
  13. {python_injection-0.10.10 → python_injection-0.10.11}/injection/_core/common/threading.py +0 -0
  14. {python_injection-0.10.10 → python_injection-0.10.11}/injection/_core/common/type.py +0 -0
  15. {python_injection-0.10.10 → python_injection-0.10.11}/injection/_core/hook.py +0 -0
  16. {python_injection-0.10.10 → python_injection-0.10.11}/injection/exceptions.py +0 -0
  17. {python_injection-0.10.10 → python_injection-0.10.11}/injection/integrations/__init__.py +0 -0
  18. {python_injection-0.10.10 → python_injection-0.10.11}/injection/integrations/blacksheep.py +0 -0
  19. {python_injection-0.10.10 → python_injection-0.10.11}/injection/py.typed +0 -0
  20. {python_injection-0.10.10 → python_injection-0.10.11}/injection/testing/__init__.py +0 -0
  21. {python_injection-0.10.10 → python_injection-0.10.11}/injection/testing/__init__.pyi +0 -0
  22. {python_injection-0.10.10 → python_injection-0.10.11}/injection/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-injection
3
- Version: 0.10.10
3
+ Version: 0.10.11
4
4
  Summary: Fast and easy dependency injection framework.
5
5
  Home-page: https://github.com/100nm/python-injection
6
6
  License: MIT
@@ -514,9 +514,10 @@ 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
- instance = wp()
518
- self.set_constant(
519
- instance,
517
+ lazy_instance = Lazy(wp)
518
+ self.injectable(
519
+ lambda: ~lazy_instance,
520
+ inject=False,
520
521
  on=on,
521
522
  mode=mode,
522
523
  )
@@ -1,6 +1,6 @@
1
1
  from collections.abc import Callable
2
2
  from types import GenericAlias
3
- from typing import Any, ClassVar, Self, TypeAliasType
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:
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "python-injection"
3
- version = "0.10.10"
3
+ version = "0.10.11"
4
4
  description = "Fast and easy dependency injection framework."
5
5
  license = "MIT"
6
6
  authors = ["remimd"]