wireup
wireup copied to clipboard
Performant, concise, and easy-to-use dependency injection container for Python 3.8+.
Add django integration. Features * Autowire middleware * Expose config in the container
Currently all integrations are deployed on release. We can use support for extras so that user installs only those relevant. https://python-poetry.org/docs/pyproject/#extras
Currently from my experience, when we are using `Annotated[AbstractClass, Wire(qualifier=Any)]` - we still need to import redundant Concrete Impl to scope, where @autowire is performed. If such import is not...
They can ask for dependencies as usual and return a function that will perform the task. ```python @container.functional def greeter_factory(translator_service: TranslatorService, other_service ...) -> Callable... def greeter(name: str, locale: str...
The `@container.autowire` decorator will simply return a new function that will bind container objects to the function on call. Since this will happen on every call, even though cached it...
Allow injection of types based on protocols. Services can declare themselves what protocol they support and the container can then perform autowiring based on that. ```python class SupportsFoo(Protocol): def foo(self)...
Users should have the option to inject everything that implements some interface or protocol(once they get added).
* `initialize_container` takes a parameters arg, so there's no need to separately update `container.params`. * `dependency_container` is optional and will recreate the container on every call` so that the function...
I want to do something like the following: ```python @service def create_transaction() -> Iterator[Transaction]: transaction = Transaction() try: yield transaction finally: transaction.commit() ``` and also an async version: ```python @service...
Tbh, you should not release this unless you compare against other established di frameworks. I should not have to figure it out. example https://lagom-di.readthedocs.io/en/latest/comparison/