Add Container provider

This commit is contained in:
Roman Mogylatov 2020-06-19 21:31:20 -04:00
parent 86021f2948
commit 1d75085c87
6 changed files with 2342 additions and 1925 deletions

View File

@ -1,4 +1,4 @@
recursive-include src/dependency_injector *.py *.pyx *.pxd *.c
recursive-include src/dependency_injector *.py *.pyx *.pxd *.c *.pyi py.typed
recursive-include tests *.py
include README.rst
include CONTRIBUTORS.rst

View File

@ -57,7 +57,11 @@ setup(name='dependency-injector',
extra_compile_args=['-O2']),
],
package_data={
'dependency_injector': ['*.pxd'],
'dependency_injector': [
'*.pxd',
'*.pyi',
'py.typed',
],
},
zip_safe=True,
license='BSD New',

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
from typing import TypeVar
R = TypeVar('R')
def Container(container: R) -> R:
...

View File

@ -606,6 +606,13 @@ cdef class DependenciesContainer(Object):
provider.override(dependency_provider)
class Container(DependenciesContainer):
def __init__(self, container):
self.container = container
super().__init__()
cdef class OverridingContext(object):
"""Provider overriding context.

View File