python-dependency-injector
python-dependency-injector copied to clipboard
Dependency injection framework for Python
I'm trying to define a container that only provides instances that extend `Foo`, however, some of these instances depend on things provided by other containers. Is this possible and what...
Idea of this issue is to create an example on how to use `Dependency Injector` with `Orator ORM`. Originally, this question was brought in #230. Acceptance criteria: - There is...
It seems that the library ignores an override if it is not done at the declaration place: - `App` has an instance of `Controllers` at `controllers` which has an instance...
I have a nested structure of containers and I wanted to perform some refactoring by adding the new container structure first and then gradually removing the current structure. However, DI...
https://python-dependency-injector.ets-labs.org/providers/configuration.html#loading-from-a-pydantic-settings In the docs, i have read this: To get the data from pydantic settings Configuration provider calls **Settings.dict() method**. If you need to pass an argument to this call,...
I tried to download the examples/miniapps/fastapi. After installing the dependencies, I ran the tests: ```py.test giphynavigator/tests.py --cov=giphynavigator``` And got errors: ``` py.test giphynavigator/tests.py --cov=giphynavigator ============================================================================================================================= test session starts ============================================================================================================================== platform...
Hi. From my tests I want to change return_value and side_effect of some methods, but some others I don't want to, so the real method is called. I've tried override...
Hello, This might be a problem with my understanding of `dependency-injector` and not a problem with the framework itself, but I could use some help looking at my problem. I...
Configuration provider will throw `ValueError: Missing required environment variable "MYENV"` when declaring a container that uses another container as a dependency. The following snippet exemplifies the behavior: ```yaml # test.yaml...
It seems the `Self` provider is not being copied properly. Consider the following: ```python class A(containers.DeclarativeContainer): __self__ = providers.Self() dep = providers.Singleton(dict, container=__self__) @containers.copy(A) class CopyA(A): # __self__ = providers.Self()...