modern-di 0.12.0__py3-none-any.whl → 0.13.0__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.

Potentially problematic release.


This version of modern-di might be problematic. Click here for more details.

modern_di/container.py CHANGED
@@ -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._check_entered()
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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: modern-di
3
- Version: 0.12.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 | [![Supported versions](https://img.shields.io/pypi/pyversions/modern-di-fastapi.svg)](https://pypi.python.org/pypi/modern-di-fastapi) [![downloads](https://img.shields.io/pypi/dm/modern-di-fastapi.svg)](https://pypistats.org/packages/modern-di-fastapi) |
27
27
  | modern-di-litestar | [![Supported versions](https://img.shields.io/pypi/pyversions/modern-di-litestar.svg)](https://pypi.python.org/pypi/modern-di-litestar) [![downloads](https://img.shields.io/pypi/dm/modern-di-litestar.svg)](https://pypistats.org/packages/modern-di-litestar) |
28
28
 
29
- Dependency injection framework for Python inspired by `dependency-injector` and `dishka`.
29
+ `modern-di` is a python dependency injection framework which, among other things,
30
+ supports the following:
30
31
 
31
- It is in development state yet and gives you the following:
32
- - DI framework with IOC-container and scopes.
33
- - Async and sync resolving.
34
- - Python 3.10-3.13 support.
35
- - Full coverage by types annotations (mypy in strict mode).
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)
@@ -1,5 +1,5 @@
1
1
  modern_di/__init__.py,sha256=L01VkzSJiV0d0FPrh1DZ-Wy5mUmoG6X-oLz7xYxtehI,194
2
- modern_di/container.py,sha256=BmviR8lr01EcdHpzvm63_otMUtw0Ytp9rUk7eG3i2IE,4948
2
+ modern_di/container.py,sha256=XlwQh7LpwilHpH6C_FYtcT1ccRZHUWPtGnGYjVy66_s,5023
3
3
  modern_di/graph.py,sha256=X60wtG3Mqus_5YZNiZlQuXoHODBp7rYl_IHJs7GzSQM,1356
4
4
  modern_di/provider_state.py,sha256=oU08QnMr0yhIZKkz0Pee8_RnWtETDE9ux4JB83qhwTI,1358
5
5
  modern_di/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -18,6 +18,6 @@ modern_di/providers/object.py,sha256=Sm0mb3Ua7cZ5Ay65fLvl7fnJDSQrQZwvzio3lkkXP2A
18
18
  modern_di/providers/resource.py,sha256=Vp8psY_svOQEJ_38DWhR8ASYpqhP9DoB7bC0jH0IlaU,4605
19
19
  modern_di/providers/selector.py,sha256=RQbHD2-Liw-TGqu6UELbfCzXYuqxiO_Mg1tLyF3mKQo,1419
20
20
  modern_di/providers/singleton.py,sha256=_hUpCmbHgLAigdhBiu0zypwWwrIGdB6_oZkGfuLxzNE,2372
21
- modern_di-0.12.0.dist-info/METADATA,sha256=AcoUZqQyNPFSJ3E5ZMTc51wpszLAqPYk7STQoa2s83c,3155
22
- modern_di-0.12.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
23
- modern_di-0.12.0.dist-info/RECORD,,
21
+ modern_di-0.13.0.dist-info/METADATA,sha256=BlNYwXqCcszdJyMBKID7bSBqAHy9iTc5W5tZLW4Ydp4,3119
22
+ modern_di-0.13.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
23
+ modern_di-0.13.0.dist-info/RECORD,,