-
Notifications
You must be signed in to change notification settings - Fork 35
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
Namespace package plugins #321
Comments
Does it work when installing with the latest pip, and/or building with the latest setuptools? Does using The other thing to check would be whether it works correctly if the installation is to a virtual environment, rather than nominating a specific target directory with "-t". |
Thanks for the suggestions @ncoghlan. 👍 Once you use the latest pip & setuptools it seems like the problems are restricted to using "-t".
The use of explicit package names vs. So thanks again for the suggestion to try |
Sounds like more issues to add to pypa/pip#4390. |
Environment: Ubuntu 19.10; Python 3.7.5; pip 18.1
References:
I'm attempting to provide a plugin system that only needs to work for Python 3.3+. Namespaces seem like a good fit as they easily allow different types of plugin to be separated out, e.g.
myapp.io_plugins
andmyapp.viz_plugins
. Given Python 3.3+ then native namespaces seem the way to go, but ...I am unable to recreate the suggested
myapp.plugins
structure from PyPA using pip.The problems are:
myapp
I can't get pip to create an emptymyapp.plugins
namespace package. Probably not a deal breaker (e.g. I can catch theImportError
), but somewhat inconvenient at best.NB. The code in the native namespace example project didn't help. It is equivalent to making
myapp
a namespace package, instead ofmyapp.plugins
and changing it to fit themyapp.plugins
guide broke the behaviour.I've tried a fair few permutations but the one that seemed closest to the PyPA guide is:
Where
setup.py
contains eitherpackages=['myapp']
orpackages=['myapp', 'myapp.plugins']
. Either way, themyapp.plugins
directory doesn't get created.python -m pip install -t /path/to/target .
results in (ignoring byte code and dist-info):The plugin is defined as:
Where
setup.py
containspackages=['myapp.plugins.myplugin']
.python -m pip install -t /path/to/target .
results in (ignoring byte code and dist-info):Despite the
Successfully ...
the only change to the installed files is the addition of the MyPlugin dist-info files - themyapp/plugins/myplugin/__init__.py
file is not installed.The text was updated successfully, but these errors were encountered: