python-dependency-injector icon indicating copy to clipboard operation
python-dependency-injector copied to clipboard

Wiring sub-libraries

Open EnrGer opened this issue 3 years ago • 0 comments

Hello, I don't know if it is available or not at the moment, but I would like to know if exists a particular feature. I developed a library that uses the dependency injection and this library uses another library that also implements the dependency injection. For the sake of explanation I'll call the first one libraryA and the second libraryB

Currently I'm working on a project that import libraryA . I wire it like shown by the documentation: container.wire(packages=[libraryA])

Obviously this solution doesn't work because the libraryB isn't directly wired, so the short term solution was:

container.wire(packages=[libraryB])
container.wire(packages=[libraryA])

in this order because otherwise it doesn't work.

In the future this libraries may be support even more projects, so my question is: Is there ia better solution to wire the packages some library depends on?

Thanks for the support.

EnrGer avatar Apr 27 '22 10:04 EnrGer