bootstrap-python-fastapi icon indicating copy to clipboard operation
bootstrap-python-fastapi copied to clipboard

Find alternative to dependency-injector framework

Open febus982 opened this issue 2 years ago • 3 comments

The project is not actively maintained except for urgent requirements: https://github.com/ets-labs/python-dependency-injector/issues/742

~Once python 3.12 is released it will pin pydantic to v1, making the package incompatible (https://github.com/ets-labs/python-dependency-injector/pull/765 https://github.com/ets-labs/python-dependency-injector/pull/752)~

Potential candidates (https://github.com/sfermigier/awesome-dependency-injection-in-python)?

  • https://github.com/python-injector/injector
  • https://github.com/ivankorobkov/python-inject
  • https://lancetnik.github.io/FastDepends/
  • https://github.com/adriangb/di
  • https://github.com/kodemore/kink
  • https://gist.github.com/johnhungerford/ccb398b666fd72e69f6798921383cb3f

febus982 avatar Nov 22 '23 00:11 febus982

https://github.com/ets-labs/python-dependency-injector/pull/752#issuecomment-1773689348 Pydantic v1 will be pinned only for tests. It's not a dependency od dependency-injector. It doesn't mean you can't use it with Python 3.12.

nhtgl avatar Nov 24 '23 08:11 nhtgl

Thanks for specifying this @macieyng I updated the issue description in case anyone stumbles on this. (This makes this issue a little less urgent to fix at least)

Unfortunately despite this, it looks like there is not much time to maintain bugs, apart from urgent requirements (from https://github.com/ets-labs/python-dependency-injector/issues/742#issuecomment-1812652596). Before python 3.12 support the last commit was almost a year ago.

A shame, because I truly love the framework (I'm not a C developer or I'd contribute to some of them).

I use only a minimal subset of the functionalities the framework provides, it might be easier to simply rewrite them in python.

febus982 avatar Nov 24 '23 22:11 febus982

The package now supports python 3.12, however this issue will remain open because I'd like to switch to a system that allows binding dependencies to class interfaces (ABC or Protocols), not only to string names.

febus982 avatar Sep 13 '24 16:09 febus982