ZipFile
ZipFile
Few notes on [external_library/external_service.py](https://github.com/Valt25/dependency_injector_issue_show_case/blob/544826ff53bd6c8406500be624a9f6b83eb015c1/external_library/external_service.py#L6C1-L7C1): 1. Markers are resolved only if you decorate something with `@inject`. 2. You're referring to the wrong container, it should be `Provide[Container.external_container.token]` (or `Provide["external_container.token"]`) to work....
1. This is undocumented behavior. I wouldn't rely on it, even if it works somehow. 2. That's right, you wire from your application's `Container`, not library one. You have to...
Thanks for the report. Nested containers and wiring is an area we can improve. No ETA when we'll work on it, but in the mean time, try doing so: diff...
@dependabot rebase
This looks like perfect use case for [contextvars](https://docs.python.org/3/library/contextvars.html). In combination with DI, you can have a `Resource` provider to init/reset the `ContextVar` and then use it in your code instead...
I do not think there is an elegant way to handle the validation the way to described. Indeed you can override `set_provides` to add a wrapper that will perform validation...
@Zevrap-81 > I cannot figure out why the config is a dictionary, while in every example it is an object with "." (dot) operator to access its variables. `Configuration` stores...
@dependabot rebase
With current implementation it is not possible to do it exactly the way you described, but you can try this instead: ```python my_client = providers.Singleton( lambda kwargs: Client(**kwargs), kwargs=config.client, )...
In v4.45.0 we've introduced [ASGI Lifespan Protocol](https://github.com/ets-labs/python-dependency-injector/blob/8460465b5edcb9ad96005a6493ec74572a5bac37/src/dependency_injector/ext/starlette.py#L12) support. It should properly handle app startups/shutdowns in combination with `Resource` providers. Give it a try.