dependency-injection-pattern 0.0.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.
Files changed (45) hide show
  1. dependency_injection_pattern-0.0.0/LICENSE +21 -0
  2. dependency_injection_pattern-0.0.0/PKG-INFO +104 -0
  3. dependency_injection_pattern-0.0.0/README.md +71 -0
  4. dependency_injection_pattern-0.0.0/pyproject.toml +48 -0
  5. dependency_injection_pattern-0.0.0/setup.cfg +4 -0
  6. dependency_injection_pattern-0.0.0/src/dependency_injection_pattern.egg-info/PKG-INFO +104 -0
  7. dependency_injection_pattern-0.0.0/src/dependency_injection_pattern.egg-info/SOURCES.txt +43 -0
  8. dependency_injection_pattern-0.0.0/src/dependency_injection_pattern.egg-info/dependency_links.txt +1 -0
  9. dependency_injection_pattern-0.0.0/src/dependency_injection_pattern.egg-info/requires.txt +5 -0
  10. dependency_injection_pattern-0.0.0/src/dependency_injection_pattern.egg-info/top_level.txt +1 -0
  11. dependency_injection_pattern-0.0.0/src/di/__init__.py +13 -0
  12. dependency_injection_pattern-0.0.0/src/di/core/container.py +336 -0
  13. dependency_injection_pattern-0.0.0/src/di/core/default_scope.py +71 -0
  14. dependency_injection_pattern-0.0.0/src/di/core/exceptions/add_exception.py +7 -0
  15. dependency_injection_pattern-0.0.0/src/di/core/exceptions/container_sealed_error.py +5 -0
  16. dependency_injection_pattern-0.0.0/src/di/core/exceptions/factory_provide_exception.py +25 -0
  17. dependency_injection_pattern-0.0.0/src/di/core/exceptions/implementation_exception.py +13 -0
  18. dependency_injection_pattern-0.0.0/src/di/core/exceptions/provide_exception.py +22 -0
  19. dependency_injection_pattern-0.0.0/src/di/core/exceptions/seal_exception.py +9 -0
  20. dependency_injection_pattern-0.0.0/src/di/core/factories/dependency.py +38 -0
  21. dependency_injection_pattern-0.0.0/src/di/core/factories/factory.py +105 -0
  22. dependency_injection_pattern-0.0.0/src/di/core/factories/scoped_factory.py +18 -0
  23. dependency_injection_pattern-0.0.0/src/di/core/factories/singleton_factory.py +32 -0
  24. dependency_injection_pattern-0.0.0/src/di/core/factories/transient_factory.py +17 -0
  25. dependency_injection_pattern-0.0.0/src/di/core/factory.py +24 -0
  26. dependency_injection_pattern-0.0.0/src/di/core/helpers.py +51 -0
  27. dependency_injection_pattern-0.0.0/src/di/core/log.py +4 -0
  28. dependency_injection_pattern-0.0.0/src/di/core/named_service.py +3 -0
  29. dependency_injection_pattern-0.0.0/src/di/core/protocols/container.py +25 -0
  30. dependency_injection_pattern-0.0.0/src/di/core/protocols/factory.py +7 -0
  31. dependency_injection_pattern-0.0.0/src/di/core/protocols/provider.py +24 -0
  32. dependency_injection_pattern-0.0.0/src/di/core/provider.py +85 -0
  33. dependency_injection_pattern-0.0.0/src/di/core/reflection/__init__.py +126 -0
  34. dependency_injection_pattern-0.0.0/src/di/core/reflection/parameter.py +66 -0
  35. dependency_injection_pattern-0.0.0/src/di/core/reflection/parameter_kind.py +9 -0
  36. dependency_injection_pattern-0.0.0/src/di/core/reflection/parameter_mapper.py +55 -0
  37. dependency_injection_pattern-0.0.0/src/di/core/reflection/signature.py +45 -0
  38. dependency_injection_pattern-0.0.0/src/di/core/reflection/undefined.py +24 -0
  39. dependency_injection_pattern-0.0.0/src/di/core/scope.py +15 -0
  40. dependency_injection_pattern-0.0.0/src/di/core/service_request.py +26 -0
  41. dependency_injection_pattern-0.0.0/src/di/exceptions.py +15 -0
  42. dependency_injection_pattern-0.0.0/tests/test_container.py +95 -0
  43. dependency_injection_pattern-0.0.0/tests/test_examples.py +178 -0
  44. dependency_injection_pattern-0.0.0/tests/test_factory.py +181 -0
  45. dependency_injection_pattern-0.0.0/tests/test_provider.py +135 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020 Dagrofa BI
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,104 @@
1
+ Metadata-Version: 2.4
2
+ Name: dependency-injection-pattern
3
+ Version: 0.0.0
4
+ Summary: Python implementation of the Dependency Injection pattern.
5
+ Author-email: Anders Madsen <anders.madsen@alphavue.com>
6
+ License: MIT
7
+ Project-URL: repository, https://github.com/apmadsen/dependency-injection-pattern
8
+ Keywords: windows,linux,dependency injection,di,dependency,injection,IoC
9
+ Classifier: Development Status :: 5 - Production/Stable
10
+ Classifier: Development Status :: 6 - Mature
11
+ Classifier: Operating System :: Microsoft :: Windows
12
+ Classifier: Operating System :: POSIX :: Linux
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Natural Language :: English
15
+ Classifier: Programming Language :: Python :: 3 :: Only
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Programming Language :: Python
22
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
23
+ Classifier: Topic :: Software Development :: Libraries
24
+ Classifier: Typing :: Typed
25
+ Requires-Python: >=3.10
26
+ Description-Content-Type: text/markdown
27
+ License-File: LICENSE
28
+ Requires-Dist: typing-utilities==0.0.2
29
+ Provides-Extra: test
30
+ Requires-Dist: pytest>=8.3; extra == "test"
31
+ Requires-Dist: pytest-cov>=6.1; extra == "test"
32
+ Dynamic: license-file
33
+
34
+ [![Test](https://github.com/apmadsen/dependency-injection-pattern/actions/workflows/python-test.yml/badge.svg)](https://github.com/apmadsen/dependency-injection-pattern/actions/workflows/python-test.yml)
35
+ [![Coverage](https://github.com/apmadsen/dependency-injection-pattern/actions/workflows/python-test-coverage.yml/badge.svg)](https://github.com/apmadsen/dependency-injection-pattern/actions/workflows/python-test-coverage.yml)
36
+ [![Stable Version](https://img.shields.io/pypi/v/dependency-injection-pattern?label=stable&sort=semver&color=blue)](https://github.com/apmadsen/dependency-injection-pattern/releases)
37
+ ![Pre-release Version](https://img.shields.io/github/v/release/apmadsen/dependency-injection-pattern?label=pre-release&include_prereleases&sort=semver&color=blue)
38
+ ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/dependency-injection-pattern)
39
+ [![PyPI Downloads](https://static.pepy.tech/badge/dependency-injection-pattern/week)](https://pepy.tech/projects/dependency-injection-pattern)
40
+
41
+ # dependency-injection-pattern
42
+ > A Python implementation of the Dependency Injection pattern.
43
+
44
+ This project extends python with a real dependency injection or Inversion of Control (IoC) implementation, relying on typing and inspection to achieve a seamless injection of dependencies.
45
+
46
+ Though not normally associated with Python applications, dependency injection can greatly reduce time spent during development and testing. Usually, in a longrunning Python application or service, you would put the container registration inside the `__main_.py` file and similar code in test files, where service implementations can easily be substituted.
47
+
48
+ ## How it works
49
+ When a service is requested, the provider looks it up in the factory dictionary, which then gets or creates a fitting instance. Any parameters needed for instantiation is supplied (injected) by the provider.
50
+
51
+ A service implementation may be inferred by a service in which case the service constructor is used, and correspondingly a service may be inferred by the return type of an implementation function.
52
+
53
+ ## Conventions
54
+ - All dependencies are resolved when container is sealed, which implements a fail-fast pattern. Only exceptions are optional dependencies or dependencies with a default value.
55
+
56
+ - Singleton services may not depend on scoped or transient services, as this would negate the "transient" or "scoped" part since a singleton service would keep a reference to it's dependencies indefinitely.
57
+
58
+ ## Example:
59
+
60
+ ```python
61
+ from logging import Logger
62
+ from di import Container
63
+
64
+ def get_logger() -> Logger:
65
+ return Logger("app")
66
+
67
+ class Service1:
68
+ def get_value(self) -> str:
69
+ return "Some value"
70
+
71
+ class Service2:
72
+ def __init__(self, service1: Service1, log: Logger):
73
+ self.service1 = service1
74
+ self.log = log
75
+
76
+ def get_value(self) -> str:
77
+ self.log.debug("Someone requested value...")
78
+ return f"Service1 returned: {self.service1.get_value()}"
79
+
80
+ class Application:
81
+ def __init__(self, service2: Service2, log: Logger):
82
+ self.service2 = service2
83
+ log.info("Application starting")
84
+
85
+ def get_value(self) -> str:
86
+ return f"Service2 returned: {self.service2.get_value()}"
87
+
88
+
89
+ container = Container()
90
+ container.add_singleton(get_logger)
91
+ container.add_transient(Service1)
92
+ container.add_transient(Service2)
93
+ container.add_transient(Application)
94
+
95
+ provider = container.provider() # container is sealed beyond this point
96
+
97
+ app = provider.provide(Application)
98
+
99
+ value = app.get_value() # => "Service2 returned: Service1 returned: Some value"
100
+ ```
101
+
102
+ ## API
103
+
104
+ [Go to API documentation](https://github.com/apmadsen/dependency-injection-pattern/blob/main/docs/api.md)
@@ -0,0 +1,71 @@
1
+ [![Test](https://github.com/apmadsen/dependency-injection-pattern/actions/workflows/python-test.yml/badge.svg)](https://github.com/apmadsen/dependency-injection-pattern/actions/workflows/python-test.yml)
2
+ [![Coverage](https://github.com/apmadsen/dependency-injection-pattern/actions/workflows/python-test-coverage.yml/badge.svg)](https://github.com/apmadsen/dependency-injection-pattern/actions/workflows/python-test-coverage.yml)
3
+ [![Stable Version](https://img.shields.io/pypi/v/dependency-injection-pattern?label=stable&sort=semver&color=blue)](https://github.com/apmadsen/dependency-injection-pattern/releases)
4
+ ![Pre-release Version](https://img.shields.io/github/v/release/apmadsen/dependency-injection-pattern?label=pre-release&include_prereleases&sort=semver&color=blue)
5
+ ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/dependency-injection-pattern)
6
+ [![PyPI Downloads](https://static.pepy.tech/badge/dependency-injection-pattern/week)](https://pepy.tech/projects/dependency-injection-pattern)
7
+
8
+ # dependency-injection-pattern
9
+ > A Python implementation of the Dependency Injection pattern.
10
+
11
+ This project extends python with a real dependency injection or Inversion of Control (IoC) implementation, relying on typing and inspection to achieve a seamless injection of dependencies.
12
+
13
+ Though not normally associated with Python applications, dependency injection can greatly reduce time spent during development and testing. Usually, in a longrunning Python application or service, you would put the container registration inside the `__main_.py` file and similar code in test files, where service implementations can easily be substituted.
14
+
15
+ ## How it works
16
+ When a service is requested, the provider looks it up in the factory dictionary, which then gets or creates a fitting instance. Any parameters needed for instantiation is supplied (injected) by the provider.
17
+
18
+ A service implementation may be inferred by a service in which case the service constructor is used, and correspondingly a service may be inferred by the return type of an implementation function.
19
+
20
+ ## Conventions
21
+ - All dependencies are resolved when container is sealed, which implements a fail-fast pattern. Only exceptions are optional dependencies or dependencies with a default value.
22
+
23
+ - Singleton services may not depend on scoped or transient services, as this would negate the "transient" or "scoped" part since a singleton service would keep a reference to it's dependencies indefinitely.
24
+
25
+ ## Example:
26
+
27
+ ```python
28
+ from logging import Logger
29
+ from di import Container
30
+
31
+ def get_logger() -> Logger:
32
+ return Logger("app")
33
+
34
+ class Service1:
35
+ def get_value(self) -> str:
36
+ return "Some value"
37
+
38
+ class Service2:
39
+ def __init__(self, service1: Service1, log: Logger):
40
+ self.service1 = service1
41
+ self.log = log
42
+
43
+ def get_value(self) -> str:
44
+ self.log.debug("Someone requested value...")
45
+ return f"Service1 returned: {self.service1.get_value()}"
46
+
47
+ class Application:
48
+ def __init__(self, service2: Service2, log: Logger):
49
+ self.service2 = service2
50
+ log.info("Application starting")
51
+
52
+ def get_value(self) -> str:
53
+ return f"Service2 returned: {self.service2.get_value()}"
54
+
55
+
56
+ container = Container()
57
+ container.add_singleton(get_logger)
58
+ container.add_transient(Service1)
59
+ container.add_transient(Service2)
60
+ container.add_transient(Application)
61
+
62
+ provider = container.provider() # container is sealed beyond this point
63
+
64
+ app = provider.provide(Application)
65
+
66
+ value = app.get_value() # => "Service2 returned: Service1 returned: Some value"
67
+ ```
68
+
69
+ ## API
70
+
71
+ [Go to API documentation](https://github.com/apmadsen/dependency-injection-pattern/blob/main/docs/api.md)
@@ -0,0 +1,48 @@
1
+ [project]
2
+ name = "dependency-injection-pattern"
3
+ dynamic = ["version"]
4
+ description = "Python implementation of the Dependency Injection pattern."
5
+ keywords = ["windows", "linux", "dependency injection", "di", "dependency", "injection", "IoC"]
6
+ readme = "README.md"
7
+ authors = [
8
+ { name = "Anders Madsen", email = "anders.madsen@alphavue.com" }
9
+ ]
10
+ license = { text = "MIT" }
11
+ classifiers = [
12
+ "Development Status :: 5 - Production/Stable",
13
+ "Development Status :: 6 - Mature",
14
+ "Operating System :: Microsoft :: Windows",
15
+ "Operating System :: POSIX :: Linux",
16
+ "Intended Audience :: Developers",
17
+ "Natural Language :: English",
18
+ "Programming Language :: Python :: 3 :: Only",
19
+ "Programming Language :: Python :: 3",
20
+ "Programming Language :: Python :: 3.10",
21
+ "Programming Language :: Python :: 3.11",
22
+ "Programming Language :: Python :: 3.12",
23
+ "Programming Language :: Python :: 3.13",
24
+ "Programming Language :: Python",
25
+ "Topic :: Software Development :: Libraries :: Python Modules",
26
+ "Topic :: Software Development :: Libraries",
27
+ "Typing :: Typed"
28
+ ]
29
+ dependencies = [
30
+ "typing-utilities==0.0.2"
31
+ ]
32
+ requires-python = ">=3.10"
33
+
34
+ [project.urls]
35
+ repository = "https://github.com/apmadsen/dependency-injection-pattern"
36
+
37
+ [project.optional-dependencies]
38
+ test = [
39
+ "pytest>=8.3",
40
+ "pytest-cov>=6.1",
41
+ ]
42
+
43
+ [tool.setuptools-git-versioning]
44
+ enabled = true
45
+
46
+ [build-system]
47
+ requires = ["setuptools >= 77.0.3", "setuptools-git-versioning >= 2.1.0"]
48
+ build-backend = "setuptools.build_meta"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,104 @@
1
+ Metadata-Version: 2.4
2
+ Name: dependency-injection-pattern
3
+ Version: 0.0.0
4
+ Summary: Python implementation of the Dependency Injection pattern.
5
+ Author-email: Anders Madsen <anders.madsen@alphavue.com>
6
+ License: MIT
7
+ Project-URL: repository, https://github.com/apmadsen/dependency-injection-pattern
8
+ Keywords: windows,linux,dependency injection,di,dependency,injection,IoC
9
+ Classifier: Development Status :: 5 - Production/Stable
10
+ Classifier: Development Status :: 6 - Mature
11
+ Classifier: Operating System :: Microsoft :: Windows
12
+ Classifier: Operating System :: POSIX :: Linux
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Natural Language :: English
15
+ Classifier: Programming Language :: Python :: 3 :: Only
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Programming Language :: Python
22
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
23
+ Classifier: Topic :: Software Development :: Libraries
24
+ Classifier: Typing :: Typed
25
+ Requires-Python: >=3.10
26
+ Description-Content-Type: text/markdown
27
+ License-File: LICENSE
28
+ Requires-Dist: typing-utilities==0.0.2
29
+ Provides-Extra: test
30
+ Requires-Dist: pytest>=8.3; extra == "test"
31
+ Requires-Dist: pytest-cov>=6.1; extra == "test"
32
+ Dynamic: license-file
33
+
34
+ [![Test](https://github.com/apmadsen/dependency-injection-pattern/actions/workflows/python-test.yml/badge.svg)](https://github.com/apmadsen/dependency-injection-pattern/actions/workflows/python-test.yml)
35
+ [![Coverage](https://github.com/apmadsen/dependency-injection-pattern/actions/workflows/python-test-coverage.yml/badge.svg)](https://github.com/apmadsen/dependency-injection-pattern/actions/workflows/python-test-coverage.yml)
36
+ [![Stable Version](https://img.shields.io/pypi/v/dependency-injection-pattern?label=stable&sort=semver&color=blue)](https://github.com/apmadsen/dependency-injection-pattern/releases)
37
+ ![Pre-release Version](https://img.shields.io/github/v/release/apmadsen/dependency-injection-pattern?label=pre-release&include_prereleases&sort=semver&color=blue)
38
+ ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/dependency-injection-pattern)
39
+ [![PyPI Downloads](https://static.pepy.tech/badge/dependency-injection-pattern/week)](https://pepy.tech/projects/dependency-injection-pattern)
40
+
41
+ # dependency-injection-pattern
42
+ > A Python implementation of the Dependency Injection pattern.
43
+
44
+ This project extends python with a real dependency injection or Inversion of Control (IoC) implementation, relying on typing and inspection to achieve a seamless injection of dependencies.
45
+
46
+ Though not normally associated with Python applications, dependency injection can greatly reduce time spent during development and testing. Usually, in a longrunning Python application or service, you would put the container registration inside the `__main_.py` file and similar code in test files, where service implementations can easily be substituted.
47
+
48
+ ## How it works
49
+ When a service is requested, the provider looks it up in the factory dictionary, which then gets or creates a fitting instance. Any parameters needed for instantiation is supplied (injected) by the provider.
50
+
51
+ A service implementation may be inferred by a service in which case the service constructor is used, and correspondingly a service may be inferred by the return type of an implementation function.
52
+
53
+ ## Conventions
54
+ - All dependencies are resolved when container is sealed, which implements a fail-fast pattern. Only exceptions are optional dependencies or dependencies with a default value.
55
+
56
+ - Singleton services may not depend on scoped or transient services, as this would negate the "transient" or "scoped" part since a singleton service would keep a reference to it's dependencies indefinitely.
57
+
58
+ ## Example:
59
+
60
+ ```python
61
+ from logging import Logger
62
+ from di import Container
63
+
64
+ def get_logger() -> Logger:
65
+ return Logger("app")
66
+
67
+ class Service1:
68
+ def get_value(self) -> str:
69
+ return "Some value"
70
+
71
+ class Service2:
72
+ def __init__(self, service1: Service1, log: Logger):
73
+ self.service1 = service1
74
+ self.log = log
75
+
76
+ def get_value(self) -> str:
77
+ self.log.debug("Someone requested value...")
78
+ return f"Service1 returned: {self.service1.get_value()}"
79
+
80
+ class Application:
81
+ def __init__(self, service2: Service2, log: Logger):
82
+ self.service2 = service2
83
+ log.info("Application starting")
84
+
85
+ def get_value(self) -> str:
86
+ return f"Service2 returned: {self.service2.get_value()}"
87
+
88
+
89
+ container = Container()
90
+ container.add_singleton(get_logger)
91
+ container.add_transient(Service1)
92
+ container.add_transient(Service2)
93
+ container.add_transient(Application)
94
+
95
+ provider = container.provider() # container is sealed beyond this point
96
+
97
+ app = provider.provide(Application)
98
+
99
+ value = app.get_value() # => "Service2 returned: Service1 returned: Some value"
100
+ ```
101
+
102
+ ## API
103
+
104
+ [Go to API documentation](https://github.com/apmadsen/dependency-injection-pattern/blob/main/docs/api.md)
@@ -0,0 +1,43 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ src/dependency_injection_pattern.egg-info/PKG-INFO
5
+ src/dependency_injection_pattern.egg-info/SOURCES.txt
6
+ src/dependency_injection_pattern.egg-info/dependency_links.txt
7
+ src/dependency_injection_pattern.egg-info/requires.txt
8
+ src/dependency_injection_pattern.egg-info/top_level.txt
9
+ src/di/__init__.py
10
+ src/di/exceptions.py
11
+ src/di/core/container.py
12
+ src/di/core/default_scope.py
13
+ src/di/core/factory.py
14
+ src/di/core/helpers.py
15
+ src/di/core/log.py
16
+ src/di/core/named_service.py
17
+ src/di/core/provider.py
18
+ src/di/core/scope.py
19
+ src/di/core/service_request.py
20
+ src/di/core/exceptions/add_exception.py
21
+ src/di/core/exceptions/container_sealed_error.py
22
+ src/di/core/exceptions/factory_provide_exception.py
23
+ src/di/core/exceptions/implementation_exception.py
24
+ src/di/core/exceptions/provide_exception.py
25
+ src/di/core/exceptions/seal_exception.py
26
+ src/di/core/factories/dependency.py
27
+ src/di/core/factories/factory.py
28
+ src/di/core/factories/scoped_factory.py
29
+ src/di/core/factories/singleton_factory.py
30
+ src/di/core/factories/transient_factory.py
31
+ src/di/core/protocols/container.py
32
+ src/di/core/protocols/factory.py
33
+ src/di/core/protocols/provider.py
34
+ src/di/core/reflection/__init__.py
35
+ src/di/core/reflection/parameter.py
36
+ src/di/core/reflection/parameter_kind.py
37
+ src/di/core/reflection/parameter_mapper.py
38
+ src/di/core/reflection/signature.py
39
+ src/di/core/reflection/undefined.py
40
+ tests/test_container.py
41
+ tests/test_examples.py
42
+ tests/test_factory.py
43
+ tests/test_provider.py
@@ -0,0 +1,5 @@
1
+ typing-utilities==0.0.2
2
+
3
+ [test]
4
+ pytest>=8.3
5
+ pytest-cov>=6.1
@@ -0,0 +1,13 @@
1
+ from di.core.container import Container
2
+ from di.core.provider import Provider
3
+ from di.core.scope import Scope
4
+ from di.core.default_scope import DefaultScope
5
+ from di.core.factory import Factory
6
+
7
+ __all__ = [
8
+ 'Container',
9
+ 'Provider',
10
+ 'Scope',
11
+ 'DefaultScope',
12
+ 'Factory'
13
+ ]