[Distutils] zc.buildout fails to use system-installed dep?

Alan Franzoni mailing at franzoni.eu
Thu Dec 9 23:25:30 CET 2010


On Thu, Dec 9, 2010 at 12:39 AM, Barry Warsaw <barry at python.org> wrote:
[cut]

After taking a look, it seems that namespace packages are involved
indeed, even though I'm not sure how yet, and there seems to be
another related bug where you commented as well:

https://bugs.launchpad.net/ubuntu/+source/python2.6/+bug/621348

I admit I'm not extremely expert at import matters, and I'm getting
mad at understanding how many levels of indirection are involved when
resolving a python import!

I tinkered around a bit trying to check whether the behaviour could be
reproduced for other modules. It seems it cannot!

I've tried installing zc.lockfile from Ubuntu packages, then i added
the "zc.dict" egg to my test recipe.

I expected to be unable to import zc.lockfile, but that wasn't the case.

nspkg.pth files exists both for zc.lockfile and zope.interface, but
while the dist-packages/zope dir has got a __init__.py file with
declare_namespace(__name__) in it, the dist-packages/zc dir hasn't.

I removed the __init__.py file in dist-packages/zope and now I'm able
to run my script without a flaw.

I must admit I don't fully understand nspkg.pth files (where can I
find more info on them? Who's creating them, setuptools/distribute?),
but their usage and the declare_namespace method seems mutually
exclusive by the way; was that confusing zc.buildout, I suppose?
Should I open a ticket on ubuntu zope.interface package?

-- 
Alan Franzoni
--
contact me at public@[mysurname].eu


More information about the Distutils-SIG mailing list