-
Notifications
You must be signed in to change notification settings - Fork 21
Description
I saw this feature in your README, and was reminded of our experience with Django and doing magical imports etc. - back in the day, your own models would end up being imported from a Django namespace, rather than your own Python modules. This was unnecessary magic that caused complications of various kinds (similar to the way that you can't do normal imports such as from growler.ext import foo). The fact that you have to mention "it doesn't work quite the way you expect" tells you that you will have trouble with it.
The end result was that we removed this feature, along with a whole lot of unnecessary magic that required people to learn “the Django way” instead of just using "the Python way" which was perfectly adequate.
In this case, it seems like this mechanism just adds complications - like:
- "More than one way to do it" (you can import the middleware from the original module names or from
growler.ext) - Requiring people to put things in certain namespaces, instead of however they want to package their code.
- Making life hard for IDEs and other tools that want to do static analysis to provide help.
There doesn't seem to be a reason why it is needed. If you really need a registry of plugins, that could be explicit. You could almost certainly use setuptools entrypoints for this - http://stackoverflow.com/questions/774824/explain-python-entry-points#9615473 https://setuptools.readthedocs.io/en/latest/pkg_resources.html#entry-points