mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2025-01-31 03:36:41 +03:00
6182b8448a
* Refactor wiring * Add todos to wiring * Implement wiring of config invariant * Implement sub containers wiring + add tests * Add test for wiring config invariant
18 lines
356 B
Python
18 lines
356 B
Python
from dependency_injector import containers, providers
|
|
|
|
from .service import Service
|
|
|
|
|
|
class SubContainer(containers.DeclarativeContainer):
|
|
|
|
int_object = providers.Object(1)
|
|
|
|
|
|
class Container(containers.DeclarativeContainer):
|
|
|
|
config = providers.Configuration()
|
|
|
|
service = providers.Factory(Service)
|
|
|
|
sub = providers.Container(SubContainer)
|