-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
pkg_resources-style namespace package issue #1097
Comments
I have encountered this same issue with a debian package on Python 3 missing the namespace |
I may found part of the problem, where setuptools is no longer using However the removal of I tracked down the original commit with the reason for skipping Just to add that I have tried in the past to move our application to native namespace but since we use eggs for plugins we need to use pkg_resources namespace so this is an annoying issue. |
Thanks @cas for summary and renewed interest in this issue. Sorry for not having responded to this issue sooner.
I would consider eggs deprecated. The PyPA has a distinct interest in removing all support for eggs. Is there a reason you couldn't use wheels (even zip wheels) for your plugins? Would you consider filing a ticket with pypa/packaging-problems and mention me, describing your use-case and what feature of eggs you rely upon?
This is not quite true. Consider, for example:
The work in #805 ended up creating As you've noticed, the omission of of What's surprising to me is that you shouldn't need the
As you can see, even after removing the -nspkg.pth file, the namespace package imports just fine, even though there's no You should be able to replicate this behavior very simply:
No The issue becomes if you install not to a one of the known site-packages directories on a Python 3.4 or earlier, the nspkg.pth file won't be loaded and the package won't load properly (on 3.3 or 3.4, it might work or there may be other issues). So I'm unable to replicate the issue in the original report. I suspect there's another factor. Maybe you have a mixed environment, where some of the paths have the namespace package with Would you do something for me? Would you work to distill the issue to as minimal a case as you can muster? If you're familiar with Docker, an easy way to share the replication is to build a Dockerfile that replicates the steps, especially if it's unique to a particular Linux environment. |
@jaraco Thanks for the comprehensive reply! I have created an issue to describe the plugins egg usage: pypa/packaging-problems#212 |
I went back and checked the debian package and realised that the Therefore the proper packaging fix was not to restore the |
Hello.
I have one issue related to namespace package. The project I am working on [0] is using pkg_resources-style namespace packages in a correct way described by documentation [1].
the process is:
<namespace-package>/__init__.py
with messageSkipping installation of /builddir/build/BUILDROOT/python-moksha-common-1.2.5-1.fc27.x86_64/usr/lib/python3.6/site-packages/moksha/__init__.py (namespace package)
In docs [1] there is:
The question is: Why setuptools skip installation of
pkg_resources-style __init__.py
file in namespace package when it must be included in every part of a namespace package?My current workaround is to add missing files to RPM package manually and then everything works. I also tried to delete
__init__.py
files from the second subpackage before running tests withpython setup.py test
(where import of the first subpackage is needed) but then it fails witherror in moksha.hub setup command: Distribution contains no modules or packages for namespace package 'moksha'
.I thought that the problem comes from Python 3.6 (bug report with more details and examples [2]) but it seems that Python 3.6 is only more strict in requiring
__init__.py
files everywhere as described in docs.Maybe I just misunderstood something.
Thank you for help and have a nice day.
[0] https://github.com/mokshaproject/moksha
[1] https://packaging.python.org/guides/packaging-namespace-packages/#pkg-resources-style-namespace-packages
[2] http://bugs.python.org/issue29144
The text was updated successfully, but these errors were encountered: