python-dependency-injector
python-dependency-injector copied to clipboard
Dependency injection framework for Python
The title is self-explanatory. This feature would make it possible to pass arguments to the `call` function, which currently lacks this capability. I believe this would be a valuable addition....
When passing a `Configuration` provider (e.g., `config.github.token`) as a parameter to another provider, `dependency-injector` passes the provider object itself instead of resolving it to the configured value. This causes the...
Partially addresses #934 Continuation of #935 Retrofitted for: - configuration.py - container.py - declarative_container.py - delegate.py - dependencies_container.py - dependency.py - dict.py - dynamic_container.py
Hello dear all. In my project I use `fastapi` and `dependency-injector` Today I upgradeded `dedpendncy-injector` 4.48.2 -> 4.48.3 after that I started to get an error in output (the app...
Closes Issue #728 , #760 #907 Relates to #699 Added a `ContextLocalResource` class that inherits from `Resource` and overrides it so that the actual `_resource` and `_shutdowner` are stored and...
Hello! I encountered with a problem, which can not solve about 3 days. This is due to the nested di containers provided by `providers. Container` or `providers.DependenciesContainer`. The main problem...
Checks in `tests/typing` intended to be exact matches should be done with `assert_type` instead of simply assigning to variables ## Explanation Consider the following functions ```python def f_any() -> Any:...
When the objects defined in the container cannot be constructed because the incorrect arguments have been passed, the stack trace that's produced when using the DI framework is not very...
My own container depends on an other container that provides a `ThreadSafeSingleton`. I would like my own container to provide this singleton as well, like a alias to the singleton....
## Background My usual usecase of Selector is when I have an interface with multiple implementations: ```python class Animal: def __init__(self) -> None: pass class Dog(Animal): pass class Cat(Animal): pass...