Description
In our project we have plenty of micro services(that are standalone git repositories). Some of them use dependency injector library to manage dependencies.
For some time ago we started using our library(that is internal for company, but external for every service).
We use external container to handle that, but for some reasons, external container, even got callable provider as dependency, but that callable miss any input parameter from origin config:
`
def _get_token(system_token: str):
print('default token in container _get_token callable provider:', system_token)
try:
token = context.token.get()
if token is None:
return system_token
return context.token.get()
except LookupError:
return system_token
class Container(containers.DeclarativeContainer):
config = providers.Configuration()
token = providers.Callable(_get_token, config.system_token)
wiring_config = containers.WiringConfiguration(
packages=(
'src',
),
)
external_container = providers.Container(
ExternalContainer,
token=token,
config=config,
)
`
I have created github repo, that show this problem https://github.com/Valt25/dependency_injector_issue_show_case.
There you can find several branches, they show different stages of project from naive usage, to container usage and the external library with container usage, and then my approach to fix it according to documentation.
Key changes is shown in README.md and you can see commits` diff.
So maybe I miss something in documentation, or misunderstand concept of dependent containers?