modern-di 0.6.0__py3-none-any.whl → 0.7.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.

@@ -1,4 +1,5 @@
1
1
  from modern_di.providers.abstract import AbstractProvider
2
+ from modern_di.providers.container_provider import ContainerProvider
2
3
  from modern_di.providers.context_adapter import ContextAdapter
3
4
  from modern_di.providers.dict import Dict
4
5
  from modern_di.providers.factory import Factory
@@ -10,6 +11,7 @@ from modern_di.providers.singleton import Singleton
10
11
 
11
12
  __all__ = [
12
13
  "AbstractProvider",
14
+ "ContainerProvider",
13
15
  "ContextAdapter",
14
16
  "Factory",
15
17
  "Dict",
@@ -0,0 +1,19 @@
1
+ import typing
2
+
3
+ import modern_di
4
+ from modern_di import Container
5
+ from modern_di.providers import AbstractProvider
6
+
7
+
8
+ T_co = typing.TypeVar("T_co", covariant=True)
9
+ P = typing.ParamSpec("P")
10
+
11
+
12
+ class ContainerProvider(AbstractProvider[modern_di.Container]):
13
+ __slots__ = AbstractProvider.BASE_SLOTS
14
+
15
+ async def async_resolve(self, container: Container) -> modern_di.Container:
16
+ return self.sync_resolve(container)
17
+
18
+ def sync_resolve(self, container: Container) -> modern_di.Container:
19
+ return container.find_container(self.scope)
@@ -1,10 +1,11 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: modern-di
3
- Version: 0.6.0
3
+ Version: 0.7.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
7
7
  Author-email: Artur Shiriev <me@shiriev.ru>
8
+ License: MIT
8
9
  Keywords: DI,dependency injector,ioc-container,mocks,python
9
10
  Classifier: Programming Language :: Python :: 3.10
10
11
  Classifier: Programming Language :: Python :: 3.11
@@ -27,13 +28,14 @@ Description-Content-Type: text/markdown
27
28
 
28
29
  Dependency injection framework for Python inspired by `dependency-injector` and `dishka`.
29
30
 
30
- It is in early development state and gives you the following:
31
+ It is in development state yet and gives you the following:
31
32
  - DI framework with IOC-container and scopes.
32
33
  - Async and sync resolving.
33
34
  - Python 3.10-3.13 support.
34
35
  - Full coverage by types annotations (mypy in strict mode).
35
36
  - Overriding dependencies for tests.
36
37
  - Package with zero dependencies.
38
+ - Integration with FastAPI and LiteStar
37
39
 
38
40
  📚 [Documentation](https://modern-di.readthedocs.io)
39
41
 
@@ -4,8 +4,9 @@ modern_di/graph.py,sha256=X60wtG3Mqus_5YZNiZlQuXoHODBp7rYl_IHJs7GzSQM,1356
4
4
  modern_di/provider_state.py,sha256=5Bl_iYEpXjMqoWZJ4op2-axo4Z8nR_vYbLVHL_u5R0c,1206
5
5
  modern_di/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  modern_di/scope.py,sha256=e6Olc-CF89clbYDNGciy-F8EqJt1Mw2703zfuJaEY94,113
7
- modern_di/providers/__init__.py,sha256=oeP3sKZJQF9COfT_YYJiLwiU3CbDfQMk4rzYHO52Xvg,555
7
+ modern_di/providers/__init__.py,sha256=r594L4kWv_XCHVZcsfUIGBtlXCmih6NR1Ifa105XoQ4,649
8
8
  modern_di/providers/abstract.py,sha256=UMj4CRn-JfGZfiveWFTkH7V92h4UXS4eYf8noZqPWGQ,3107
9
+ modern_di/providers/container_provider.py,sha256=r5IEQXgKtPwvHvbqkbPnmGyDGGCCjokTtdard9Rvt40,548
9
10
  modern_di/providers/context_adapter.py,sha256=_b1x3ToQPWT-9KkDioFhw1W8Q1VXZYUnczfYzMTobVA,760
10
11
  modern_di/providers/dict.py,sha256=nCU9iaqteYHDbILAfhrdnbMgS9_emE4MS7Xn2VoUlPo,858
11
12
  modern_di/providers/factory.py,sha256=NozbrprJlRJPWSNdvKR0kOwPt1Q9i_ZLJTPOfzdDDJo,1359
@@ -14,6 +15,6 @@ modern_di/providers/list.py,sha256=3hx34RfBRmqzh-cT5D6wSTDJPkBGMK_ul4n9gQz-o9M,7
14
15
  modern_di/providers/resource.py,sha256=UwIrX63Crf5iUXu3cp80hw7orl9ahy8frstxAf1Y7wc,4098
15
16
  modern_di/providers/selector.py,sha256=RQbHD2-Liw-TGqu6UELbfCzXYuqxiO_Mg1tLyF3mKQo,1419
16
17
  modern_di/providers/singleton.py,sha256=7XBNhVzhV5Rh_F7iWZx8is7i7_PuctQ9thKeqIkjnTs,1999
17
- modern_di-0.6.0.dist-info/METADATA,sha256=Hw--koCvjKCjWQsTIYc61x7drsUZnAnRZJwnI16N1ek,5389
18
- modern_di-0.6.0.dist-info/WHEEL,sha256=wukiCwsxxsuzcQTdnC_ZWHZECE4wwOh3xCCrap6i6Ts,87
19
- modern_di-0.6.0.dist-info/RECORD,,
18
+ modern_di-0.7.0.dist-info/METADATA,sha256=ay_YO5-O-3KDxOiIKF_jR3g421IV-dwltkIo6_sr1U8,5440
19
+ modern_di-0.7.0.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
20
+ modern_di-0.7.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.26.0
2
+ Generator: hatchling 1.26.3
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any