python-injection 0.18.12__tar.gz → 0.18.13__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.
- {python_injection-0.18.12 → python_injection-0.18.13}/PKG-INFO +1 -1
- {python_injection-0.18.12 → python_injection-0.18.13}/injection/loaders.py +15 -0
- {python_injection-0.18.12 → python_injection-0.18.13}/pyproject.toml +1 -1
- {python_injection-0.18.12 → python_injection-0.18.13}/.gitignore +0 -0
- {python_injection-0.18.12 → python_injection-0.18.13}/LICENSE +0 -0
- {python_injection-0.18.12 → python_injection-0.18.13}/README.md +0 -0
- {python_injection-0.18.12 → python_injection-0.18.13}/injection/__init__.py +0 -0
- {python_injection-0.18.12 → python_injection-0.18.13}/injection/__init__.pyi +0 -0
- {python_injection-0.18.12 → python_injection-0.18.13}/injection/_core/__init__.py +0 -0
- {python_injection-0.18.12 → python_injection-0.18.13}/injection/_core/common/__init__.py +0 -0
- {python_injection-0.18.12 → python_injection-0.18.13}/injection/_core/common/asynchronous.py +0 -0
- {python_injection-0.18.12 → python_injection-0.18.13}/injection/_core/common/event.py +0 -0
- {python_injection-0.18.12 → python_injection-0.18.13}/injection/_core/common/invertible.py +0 -0
- {python_injection-0.18.12 → python_injection-0.18.13}/injection/_core/common/key.py +0 -0
- {python_injection-0.18.12 → python_injection-0.18.13}/injection/_core/common/lazy.py +0 -0
- {python_injection-0.18.12 → python_injection-0.18.13}/injection/_core/common/threading.py +0 -0
- {python_injection-0.18.12 → python_injection-0.18.13}/injection/_core/common/type.py +0 -0
- {python_injection-0.18.12 → python_injection-0.18.13}/injection/_core/descriptors.py +0 -0
- {python_injection-0.18.12 → python_injection-0.18.13}/injection/_core/injectables.py +0 -0
- {python_injection-0.18.12 → python_injection-0.18.13}/injection/_core/module.py +0 -0
- {python_injection-0.18.12 → python_injection-0.18.13}/injection/_core/scope.py +0 -0
- {python_injection-0.18.12 → python_injection-0.18.13}/injection/_core/slots.py +0 -0
- {python_injection-0.18.12 → python_injection-0.18.13}/injection/entrypoint.py +0 -0
- {python_injection-0.18.12 → python_injection-0.18.13}/injection/exceptions.py +0 -0
- {python_injection-0.18.12 → python_injection-0.18.13}/injection/ext/__init__.py +0 -0
- {python_injection-0.18.12 → python_injection-0.18.13}/injection/ext/fastapi.py +0 -0
- {python_injection-0.18.12 → python_injection-0.18.13}/injection/ext/fastapi.pyi +0 -0
- {python_injection-0.18.12 → python_injection-0.18.13}/injection/py.typed +0 -0
- {python_injection-0.18.12 → python_injection-0.18.13}/injection/testing/__init__.py +0 -0
- {python_injection-0.18.12 → python_injection-0.18.13}/injection/testing/__init__.pyi +0 -0
@@ -149,6 +149,15 @@ class ProfileLoader:
|
|
149
149
|
def __is_empty(self) -> bool:
|
150
150
|
return not self.module_subsets
|
151
151
|
|
152
|
+
def required_module_names(self, name: str | None = None, /) -> frozenset[str]:
|
153
|
+
names = {self.module.name}
|
154
|
+
|
155
|
+
if name is not None:
|
156
|
+
names.add(name)
|
157
|
+
|
158
|
+
subsets = (self.__walk_subsets_for(name) for name in names)
|
159
|
+
return frozenset(itertools.chain.from_iterable(subsets))
|
160
|
+
|
152
161
|
def init(self) -> Self:
|
153
162
|
self.__init_subsets_for(self.module)
|
154
163
|
return self
|
@@ -179,6 +188,12 @@ class ProfileLoader:
|
|
179
188
|
def __mark_initialized(self, module: Module) -> None:
|
180
189
|
self.__initialized_modules.add(module.name)
|
181
190
|
|
191
|
+
def __walk_subsets_for(self, module_name: str) -> Iterator[str]:
|
192
|
+
yield module_name
|
193
|
+
|
194
|
+
for name in self.module_subsets.get(module_name, ()):
|
195
|
+
yield from self.__walk_subsets_for(name)
|
196
|
+
|
182
197
|
|
183
198
|
@runtime_checkable
|
184
199
|
class LoadedProfile(Protocol):
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{python_injection-0.18.12 → python_injection-0.18.13}/injection/_core/common/asynchronous.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|