python-injection 0.18.6__py3-none-any.whl → 0.18.6.post0__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/loaders.py CHANGED
@@ -141,28 +141,28 @@ class PythonModuleLoader:
141
141
 
142
142
  @dataclass(repr=False, eq=False, frozen=True, slots=True)
143
143
  class ProfileLoader:
144
- dependencies: Mapping[str, Sequence[str]] = field(default=MappingProxyType({}))
144
+ module_subsets: Mapping[str, Sequence[str]] = field(default=MappingProxyType({}))
145
145
  module: Module = field(default_factory=mod, kw_only=True)
146
146
  __initialized_modules: set[str] = field(default_factory=set, init=False)
147
147
 
148
148
  def init(self) -> Self:
149
- self.__init_module_dependencies(self.module)
149
+ self.__init_subsets_for(self.module)
150
150
  return self
151
151
 
152
152
  def load(self, name: str, /) -> LoadedProfile:
153
153
  self.init()
154
- target_module = self.__init_module_dependencies(mod(name))
154
+ target_module = self.__init_subsets_for(mod(name))
155
155
  self.module.use(target_module, priority=Priority.HIGH)
156
156
  return _UserLoadedProfile(self, name)
157
157
 
158
158
  def _unload(self, name: str, /) -> None:
159
159
  self.module.unlock().stop_using(mod(name))
160
160
 
161
- def __init_module_dependencies(self, module: Module) -> Module:
161
+ def __init_subsets_for(self, module: Module) -> Module:
162
162
  if not self.__is_initialized(module):
163
163
  target_modules = tuple(
164
- self.__init_module_dependencies(mod(profile_name))
165
- for profile_name in self.dependencies.get(module.name, ())
164
+ self.__init_subsets_for(mod(name))
165
+ for name in self.module_subsets.get(module.name, ())
166
166
  )
167
167
  module.unlock().init_modules(*target_modules)
168
168
  self.__mark_initialized(module)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-injection
3
- Version: 0.18.6
3
+ Version: 0.18.6.post0
4
4
  Summary: Fast and easy dependency injection framework.
5
5
  Project-URL: Repository, https://github.com/100nm/python-injection
6
6
  Author: remimd
@@ -2,7 +2,7 @@ injection/__init__.py,sha256=7ZRUlO5EEPWO7IlbYHD-8DOX-cg4Np4nYq5fpw-U56o,1259
2
2
  injection/__init__.pyi,sha256=33A511o3QKQAiQOHL8OQtFPdF-ObM1BqWPmswXhxj7c,10634
3
3
  injection/entrypoint.py,sha256=12b0_zHAFxHCerAoJTIHkhqi3mLkgheECYAaCUZv_DU,4751
4
4
  injection/exceptions.py,sha256=v57yMujiq6H_zwwn30A8UYEZX9R9k-bY8FnsdaimPM4,1025
5
- injection/loaders.py,sha256=_0V64d45WoT0OVWML8ZQts4gMXCbT7LkCS3KLl6STMI,6509
5
+ injection/loaders.py,sha256=_IpsMhsDrto-OeMaBdD5b71wqzxhWnxgB-Fv2H3T4Zs,6465
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
@@ -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=bJ7WXBXrw4rHc91AFVFnOwFLWOlpvX9Oh2SnRQ_NESo,919
24
24
  injection/testing/__init__.pyi,sha256=raGsGlxwbz3jkzJwA_5oCIE1emWINjT2UuwzbnqRb-0,577
25
- python_injection-0.18.6.dist-info/METADATA,sha256=J8D8DrVAJfAoGen7LNrtT303UXR5yUT5fYw6P6ufVsQ,3397
26
- python_injection-0.18.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
27
- python_injection-0.18.6.dist-info/licenses/LICENSE,sha256=oC77BOa9kaaQni5rW-Z-ytz3E5h4EVg248BHg9UFgyg,1063
28
- python_injection-0.18.6.dist-info/RECORD,,
25
+ python_injection-0.18.6.post0.dist-info/METADATA,sha256=AG7FsuCwRVZquzk1Yq5iClyGofdaM4IeAhcTskhlap0,3403
26
+ python_injection-0.18.6.post0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
27
+ python_injection-0.18.6.post0.dist-info/licenses/LICENSE,sha256=oC77BOa9kaaQni5rW-Z-ytz3E5h4EVg248BHg9UFgyg,1063
28
+ python_injection-0.18.6.post0.dist-info/RECORD,,