python-injection 0.18.0.post0__tar.gz → 0.18.1__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 (29) hide show
  1. python_injection-0.18.1/LICENSE +21 -0
  2. {python_injection-0.18.0.post0 → python_injection-0.18.1}/PKG-INFO +3 -2
  3. {python_injection-0.18.0.post0 → python_injection-0.18.1}/injection/_core/module.py +2 -2
  4. {python_injection-0.18.0.post0 → python_injection-0.18.1}/injection/entrypoint.py +8 -0
  5. {python_injection-0.18.0.post0 → python_injection-0.18.1}/pyproject.toml +3 -2
  6. {python_injection-0.18.0.post0 → python_injection-0.18.1}/.gitignore +0 -0
  7. {python_injection-0.18.0.post0 → python_injection-0.18.1}/README.md +0 -0
  8. {python_injection-0.18.0.post0 → python_injection-0.18.1}/injection/__init__.py +0 -0
  9. {python_injection-0.18.0.post0 → python_injection-0.18.1}/injection/__init__.pyi +0 -0
  10. {python_injection-0.18.0.post0 → python_injection-0.18.1}/injection/_core/__init__.py +0 -0
  11. {python_injection-0.18.0.post0 → python_injection-0.18.1}/injection/_core/common/__init__.py +0 -0
  12. {python_injection-0.18.0.post0 → python_injection-0.18.1}/injection/_core/common/asynchronous.py +0 -0
  13. {python_injection-0.18.0.post0 → python_injection-0.18.1}/injection/_core/common/event.py +0 -0
  14. {python_injection-0.18.0.post0 → python_injection-0.18.1}/injection/_core/common/invertible.py +0 -0
  15. {python_injection-0.18.0.post0 → python_injection-0.18.1}/injection/_core/common/key.py +0 -0
  16. {python_injection-0.18.0.post0 → python_injection-0.18.1}/injection/_core/common/lazy.py +0 -0
  17. {python_injection-0.18.0.post0 → python_injection-0.18.1}/injection/_core/common/type.py +0 -0
  18. {python_injection-0.18.0.post0 → python_injection-0.18.1}/injection/_core/descriptors.py +0 -0
  19. {python_injection-0.18.0.post0 → python_injection-0.18.1}/injection/_core/injectables.py +0 -0
  20. {python_injection-0.18.0.post0 → python_injection-0.18.1}/injection/_core/scope.py +0 -0
  21. {python_injection-0.18.0.post0 → python_injection-0.18.1}/injection/_core/slots.py +0 -0
  22. {python_injection-0.18.0.post0 → python_injection-0.18.1}/injection/exceptions.py +0 -0
  23. {python_injection-0.18.0.post0 → python_injection-0.18.1}/injection/ext/__init__.py +0 -0
  24. {python_injection-0.18.0.post0 → python_injection-0.18.1}/injection/ext/fastapi.py +0 -0
  25. {python_injection-0.18.0.post0 → python_injection-0.18.1}/injection/ext/fastapi.pyi +0 -0
  26. {python_injection-0.18.0.post0 → python_injection-0.18.1}/injection/loaders.py +0 -0
  27. {python_injection-0.18.0.post0 → python_injection-0.18.1}/injection/py.typed +0 -0
  28. {python_injection-0.18.0.post0 → python_injection-0.18.1}/injection/testing/__init__.py +0 -0
  29. {python_injection-0.18.0.post0 → python_injection-0.18.1}/injection/testing/__init__.pyi +0 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 remimd
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1,10 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-injection
3
- Version: 0.18.0.post0
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
7
- License: MIT
7
+ License-Expression: MIT
8
+ License-File: LICENSE
8
9
  Keywords: dependencies,dependency,inject,injection
9
10
  Classifier: Development Status :: 4 - Beta
10
11
  Classifier: Intended Audience :: Developers
@@ -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:
@@ -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]:
@@ -29,9 +29,10 @@ test = [
29
29
 
30
30
  [project]
31
31
  name = "python-injection"
32
- version = "0.18.0.post0"
32
+ version = "0.18.1"
33
33
  description = "Fast and easy dependency injection framework."
34
- license = { text = "MIT" }
34
+ license = "MIT"
35
+ license-files = ["LICENSE"]
35
36
  readme = "README.md"
36
37
  requires-python = ">=3.12, <4"
37
38
  authors = [{ name = "remimd" }]