python-injection 0.18.0.post1__py3-none-any.whl → 0.18.1__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.
injection/_core/module.py CHANGED
@@ -816,11 +816,11 @@ class Module(Broker, EventListener):
816
816
  self.unlock().init_modules(*modules)
817
817
 
818
818
  @contextmanager
819
- def cleaner() -> Iterator[Self]:
819
+ def unload() -> Iterator[Self]:
820
820
  yield self
821
821
  self.unlock().init_modules()
822
822
 
823
- return cleaner()
823
+ return unload()
824
824
 
825
825
  async def all_ready(self) -> None:
826
826
  for broker in self.__brokers:
injection/entrypoint.py CHANGED
@@ -105,6 +105,14 @@ class Entrypoint[**P, T]:
105
105
  ) -> Self:
106
106
  return self.setup(lambda: loader.load(*packages))
107
107
 
108
+ def load_profile(self, /, *names: str) -> Self:
109
+ @contextmanager
110
+ def decorator(module: Module) -> Iterator[None]:
111
+ with module.load_profile(*names):
112
+ yield
113
+
114
+ return self.decorate(decorator(self.module))
115
+
108
116
  def setup(self, function: Callable[..., Any], /) -> Self:
109
117
  @contextmanager
110
118
  def decorator() -> Iterator[Any]:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-injection
3
- Version: 0.18.0.post1
3
+ Version: 0.18.1
4
4
  Summary: Fast and easy dependency injection framework.
5
5
  Project-URL: Repository, https://github.com/100nm/python-injection
6
6
  Author: remimd
@@ -1,13 +1,13 @@
1
1
  injection/__init__.py,sha256=7ZRUlO5EEPWO7IlbYHD-8DOX-cg4Np4nYq5fpw-U56o,1259
2
2
  injection/__init__.pyi,sha256=O2W6ZWcwH58JnDmJNkJ6cdoaO0D2NE7PEVFgfJNTwB0,10717
3
- injection/entrypoint.py,sha256=UImrgGmzbkjVZemzzmpr-5hazej3NdI65_RuUbyHuJs,4205
3
+ injection/entrypoint.py,sha256=oTOwU2MXAaATuawADQ4KOPp5Tet2gL4dJD0IdClZ8sY,4461
4
4
  injection/exceptions.py,sha256=v57yMujiq6H_zwwn30A8UYEZX9R9k-bY8FnsdaimPM4,1025
5
5
  injection/loaders.py,sha256=8tS3zVvmxKf5E1ZJBTBjZpHkXETxNCL1dq8rbh2vzy4,4075
6
6
  injection/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  injection/_core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
8
  injection/_core/descriptors.py,sha256=jH0pyIlPurMmU4yXr-HKS_7BJ-9d0XUvEx4pQre3QeI,704
9
9
  injection/_core/injectables.py,sha256=Rg1nxDkbcpeX4ELohrNVMguPhN36SNQuD0JKfyfL6bI,6192
10
- injection/_core/module.py,sha256=7jTp3dHHQqJ_b95iHHMp9TKRF794Msgla7UfBsLysV8,31988
10
+ injection/_core/module.py,sha256=EV8EtaMlS3wOuYk4Z50Lov_gTSK6OII6RUWUGCWizYU,31986
11
11
  injection/_core/scope.py,sha256=OBzVY1mUApryqIZKQtwHz7wiuY13MfouyaHp50DpWeQ,8300
12
12
  injection/_core/slots.py,sha256=g9TG6CbqRzCsjg01iPyfRtTTUCJnnJOwcj9mJabH0dc,37
13
13
  injection/_core/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -22,7 +22,7 @@ injection/ext/fastapi.py,sha256=layUUer5IWiZX6Mmx1_RCYDLNCtEHtpya5ZL6TTBOkY,968
22
22
  injection/ext/fastapi.pyi,sha256=8OZEUjHFB9n7QXv_dtXdDuXW-r2huQEFsJ03gJOOvwQ,125
23
23
  injection/testing/__init__.py,sha256=PsrvNxYvn11if8CJpEYxcTxniqMt2w_7fBaDkY9RA5o,898
24
24
  injection/testing/__init__.pyi,sha256=iOii0i9F5n7znltGeGQYI2KXC_if9SAogLh1h03yx-0,540
25
- python_injection-0.18.0.post1.dist-info/METADATA,sha256=D9sJDVaoT9GZdhm0WmbB0v_e5WqqrRL44tvbTsEVxLc,3403
26
- python_injection-0.18.0.post1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
27
- python_injection-0.18.0.post1.dist-info/licenses/LICENSE,sha256=oC77BOa9kaaQni5rW-Z-ytz3E5h4EVg248BHg9UFgyg,1063
28
- python_injection-0.18.0.post1.dist-info/RECORD,,
25
+ python_injection-0.18.1.dist-info/METADATA,sha256=kJtYqmlxmGrFk-B42yZ_tTmZBPVWywETVqO6xqc01Bs,3397
26
+ python_injection-0.18.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
27
+ python_injection-0.18.1.dist-info/licenses/LICENSE,sha256=oC77BOa9kaaQni5rW-Z-ytz3E5h4EVg248BHg9UFgyg,1063
28
+ python_injection-0.18.1.dist-info/RECORD,,