modern-di 0.12.0__tar.gz → 0.13.0__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.
Potentially problematic release.
This version of modern-di might be problematic. Click here for more details.
- {modern_di-0.12.0 → modern_di-0.13.0}/PKG-INFO +13 -11
- {modern_di-0.12.0 → modern_di-0.13.0}/modern_di/container.py +7 -4
- {modern_di-0.12.0 → modern_di-0.13.0}/.gitignore +0 -0
- {modern_di-0.12.0 → modern_di-0.13.0}/modern_di/__init__.py +0 -0
- {modern_di-0.12.0 → modern_di-0.13.0}/modern_di/graph.py +0 -0
- {modern_di-0.12.0 → modern_di-0.13.0}/modern_di/helpers/__init__.py +0 -0
- {modern_di-0.12.0 → modern_di-0.13.0}/modern_di/helpers/attr_getter_helpers.py +0 -0
- {modern_di-0.12.0 → modern_di-0.13.0}/modern_di/provider_state.py +0 -0
- {modern_di-0.12.0 → modern_di-0.13.0}/modern_di/providers/__init__.py +0 -0
- {modern_di-0.12.0 → modern_di-0.13.0}/modern_di/providers/abstract.py +0 -0
- {modern_di-0.12.0 → modern_di-0.13.0}/modern_di/providers/container_provider.py +0 -0
- {modern_di-0.12.0 → modern_di-0.13.0}/modern_di/providers/context_adapter.py +0 -0
- {modern_di-0.12.0 → modern_di-0.13.0}/modern_di/providers/dict.py +0 -0
- {modern_di-0.12.0 → modern_di-0.13.0}/modern_di/providers/factory.py +0 -0
- {modern_di-0.12.0 → modern_di-0.13.0}/modern_di/providers/injected_factory.py +0 -0
- {modern_di-0.12.0 → modern_di-0.13.0}/modern_di/providers/list.py +0 -0
- {modern_di-0.12.0 → modern_di-0.13.0}/modern_di/providers/object.py +0 -0
- {modern_di-0.12.0 → modern_di-0.13.0}/modern_di/providers/resource.py +0 -0
- {modern_di-0.12.0 → modern_di-0.13.0}/modern_di/providers/selector.py +0 -0
- {modern_di-0.12.0 → modern_di-0.13.0}/modern_di/providers/singleton.py +0 -0
- {modern_di-0.12.0 → modern_di-0.13.0}/modern_di/py.typed +0 -0
- {modern_di-0.12.0 → modern_di-0.13.0}/modern_di/scope.py +0 -0
- {modern_di-0.12.0 → modern_di-0.13.0}/pyproject.toml +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: modern-di
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.13.0
|
|
4
4
|
Summary: Dependency Injection framework with IOC-container and scopes
|
|
5
5
|
Project-URL: repository, https://github.com/modern-python/modern-di
|
|
6
6
|
Project-URL: docs, https://modern-di.readthedocs.io
|
|
@@ -26,16 +26,18 @@ Description-Content-Type: text/markdown
|
|
|
26
26
|
| modern-di-fastapi | [](https://pypi.python.org/pypi/modern-di-fastapi) [](https://pypistats.org/packages/modern-di-fastapi) |
|
|
27
27
|
| modern-di-litestar | [](https://pypi.python.org/pypi/modern-di-litestar) [](https://pypistats.org/packages/modern-di-litestar) |
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
`modern-di` is a python dependency injection framework which, among other things,
|
|
30
|
+
supports the following:
|
|
30
31
|
|
|
31
|
-
|
|
32
|
-
-
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
- Overriding dependencies for tests.
|
|
37
|
-
- Package with zero dependencies.
|
|
38
|
-
- Integration with FastAPI and LiteStar
|
|
32
|
+
- Async and sync dependency resolution
|
|
33
|
+
- Scopes and granular context management
|
|
34
|
+
- Python 3.10+ support
|
|
35
|
+
- Fully typed and tested
|
|
36
|
+
- Compatibility with popular frameworks like `FastAPI` and `LiteStar`
|
|
39
37
|
- Thread-safe and asyncio concurrency safe providers
|
|
40
38
|
|
|
41
|
-
📚 [Documentation](https://modern-di.readthedocs.io)
|
|
39
|
+
## 📚 [Documentation](https://modern-di.readthedocs.io)
|
|
40
|
+
|
|
41
|
+
## 📦 [PyPi](https://pypi.org/project/modern-di)
|
|
42
|
+
|
|
43
|
+
## 📝 [License](LICENSE)
|
|
@@ -123,16 +123,19 @@ class Container(contextlib.AbstractAsyncContextManager["Container"], contextlib.
|
|
|
123
123
|
self._is_async = True
|
|
124
124
|
return self
|
|
125
125
|
|
|
126
|
+
async def async_close(self) -> None:
|
|
127
|
+
self._check_entered()
|
|
128
|
+
for provider_state in reversed(self._provider_states.values()):
|
|
129
|
+
await provider_state.async_tear_down()
|
|
130
|
+
self._exit()
|
|
131
|
+
|
|
126
132
|
async def __aexit__(
|
|
127
133
|
self,
|
|
128
134
|
exc_type: type[BaseException] | None,
|
|
129
135
|
exc_val: BaseException | None,
|
|
130
136
|
traceback: types.TracebackType | None,
|
|
131
137
|
) -> None:
|
|
132
|
-
self.
|
|
133
|
-
for provider_state in reversed(self._provider_states.values()):
|
|
134
|
-
await provider_state.async_tear_down()
|
|
135
|
-
self._exit()
|
|
138
|
+
await self.async_close()
|
|
136
139
|
|
|
137
140
|
def __enter__(self) -> "Container":
|
|
138
141
|
self._is_async = False
|
|
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
|
|
File without changes
|