-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggestion: remove growler.ext mechanism #16
Comments
Ohh, so there could be some standard The goal of the growler_ext namespace and the Mostly, it was just for me learn how to use namespaces properly - which was non-trivial due to the amount of legacy "best practices" which can be found online. I will look into the entrypoints methods when I start to work on growler again; I'm currently focusing on other works and don't have the time for this side project. If you (or anyone else reading this) would like to provide a implementation, please go ahead! Thanks again. |
I've refactored the extension mechanism to use All a package has to do to add a class or function to the setup(
...
entry_points={
'growler.ext': [
'MyRenderer = my_package.growler:MyRenderer
],
}
...
) Here is the new module source. It scans through and loads all members of the I'd appreciate any comments. The docs still need updating. |
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:
growler.ext
)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
The text was updated successfully, but these errors were encountered: