-
Notifications
You must be signed in to change notification settings - Fork 5
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
Load plugins via setuptools entrypoints #15
Comments
lml picks up modules from current python environment using pkgutil.iter_modules(). If the package has not been installed, I'm afraid that lml has no power. This is my current understanding. and I need more enlightenment. |
after the package installation, if the entry is exposed somehow, then lml can try to access it. |
The need is to find & load installed packages registered under entry point 'python.templating.engines'. I expect this will stop lml being lightweight ;-) So maybe it is better for moban to load them using setuptools, or another wrapper if helpful. |
coala/coala#5755 provides a much safer way to use setuptools. |
I had a look. thanks for the pointer. See my comments below The entry point specs in coala's setup point to an included directory with the installed package. And when coala starts, all end points were scanned for bears and bears are then loaded. I had a look at https://github.com/coala/coala-bears/blob/master/bears directory and all official bears are found there. From lml's perspective, lml asks for each lml based python package to expose their spec in highest level of init.py, i.e. https://github.com/moremoban/moban-handlebars/blob/dev/moban_handlebars/__init__.py, where the relative path of the plugin location is then up to the plugin developer to decide. If lml is to support coala's way of loading bears, lml can take advantage of existing coala code to find out where the bears but still lml would require https://github.com/coala/coala-bears/blob/master/bears/__init__.py to give a full specification/registry of all bears. Once Why should |
https://gitlab.com/coala/bears has more bear. But primary motivation is hook 'python.templating.engines' |
https://pypi.org/project/entrypoints/ could be helpful. |
Just found Python file system 2 use setup entry points too. |
See moremoban/moban#191 for the need.
coala
could also use this, as it loads bears using setuptools, and it would be really nice to have the setuptools dependency/problem managed.I'm not sure lml is the best option, but it is worth asking the question and having a decision whether this would work.
There are three options, either
If the first option is taken, there are a lot of versions of setuptools which are broken and need blacklisting, depending on which features is used, so it would be helpful to have a set of tests here which verify all supported versions of setuptools load the hooks correctly.
The text was updated successfully, but these errors were encountered: