Multi-level package namespaces break with Setuptools 38 #1214
Comments
Proposed fix here: #1215 |
It doesn't work yet for me. I'm trying to get buildout to work with the new wheel support in buildout/buildout#428, but the tests don't run because the namespace package zope.testrunner isn't importable In the fix, on line da1c78f#diff-17b52a268b98d01dd98fa746689f9383R135, you look for I don't know if the wheel is incorrect or if If I add an |
I suggest we reopen this issue until @reinout's comment is addressed. I've made a concrete suggestion for a fix here. |
@reinout, Can you check if the fix I proposed above solves the namespace package issue on |
@reinout: I can't reproduce the issue, can you give more detailed steps? Here is what I used: > python -m venv venv
> ./venv/bin/pip install -q -U setuptools
> ./venv/bin/easy_install -q zope.testrunner
> ./venv/bin/pip freeze --all
pip==9.0.1
setuptools==38.2.3
six==1.11.0
zope.exceptions==4.2.0
zope.interface==4.4.3
zope.testrunner==4.8.1
> ./venv/bin/python -c 'import zope'
> ls venv/lib/python3.6/site-packages/zope.testrunner-4.8.1-py3.6.egg/zope/__init__.py
venv/lib/python3.6/site-packages/zope.testrunner-4.8.1-py3.6.egg/zope/__init__.py |
The link of @leorochael is faulty, this is the right one: #1215 (comment) @benoit-pierre I "tested" it through buildout's tests. I'll see if I can make a small example (though yours looks good). |
@benoit-pierre, here is a reproduction:
Here we make use of an explicit (though not often used) use-case of setuptools, a plugin directory that is populated with eggs that are dynamically installed by the aplication:
And here we make use of the plugins directory:
All of the packages above should have been imported. Not only |
That's a different problem from mine. In my case, zope.interface and zope.exceptions can be imported just fine (being build from a zope.testrunner is a |
I can't reproduce: > python2 -m virtualenv venv
New python executable in venv/bin/python2
Also creating executable in venv/bin/python
Installing setuptools, pip, wheel...done.
> ./venv/bin/pip install -q -U setuptools
> ./venv/bin/pip freeze --all
pip==9.0.1
setuptools==38.2.3
wheel==0.30.0
> mkdir plugins
> PYTHONPATH=plugins ./venv/bin/easy_install -qm -s scripts -d plugins zope.testrunner
> ls plugins
six-1.11.0-py2.7.egg/ zope.interface-4.4.3-py2.7-linux-x86_64.egg/
zope.exceptions-4.2.0-py2.7.egg/ zope.testrunner-4.8.1-py2.7.egg/
> ./venv/bin/python
Python 2.7.14 (default, Sep 20 2017, 01:25:59)
[GCC 7.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import glob, sys
>>> sys.path[:0] = glob.glob('plugins/*.egg')
>>> import zope.testrunner
>>> zope.__file__
'[...]/plugins/zope.interface-4.4.3-py2.7-linux-x86_64.egg/zope/__init__.py'
>>> |
I think we can close this again. Setuptools handles it just fine. |
It's still closed ;-) And I can't reproduce it either. don't know what I did wrong the first time on my reproduction. Sorry for the noise. |
Multi-level packages imported via
setup.py develop
work in Setuptools 37, but fail in Setuptools 38.x due to missing__init__.py
in the upper levels of the namespace.For example, after installing
protobuf
, a simpleimport google.protobuf.message
should work but doesn't. It can be hacked around bytouch protobuf-3.5.0.post1-py2.7.egg/google/__init__.py
insite-packages
.Setuptools 37.0
~/tmp/s38.py:
Setuptools 38.2.1
Diffing the Trees
The text was updated successfully, but these errors were encountered: