[Pythonmac-SIG] py2app not happy with zope.interface

Ronald Oussoren ronaldoussoren at mac.com
Fri Jul 30 08:06:45 CEST 2010


On 22 Jul, 2010, at 19:06, Russell E. Owen wrote:
>>> 
>> 
>> How did you install zope.interface? Basically which easy_install or pip 
>> command-line did you use to install?
> 
> I used "pip install zope.interface".


When you use "pip install" to install packages namespace packages get installed in an odd way: the __init__.py file in the namespace package is not installed, and pth file is installed to fakes having a real package, for zope.interface the following
tet installed:

* zope
* zope.interface-3.6.1-py2.7-nspkg.pth
* zope.interface-3.6.1-py2.7.egg-info

The nspkg.pth file is very ugly: 

import sys,types,os; p = os.path.join(sys._getframe(1).f_locals['sitedir'], *('zope',)); ie = os.path.exists(os.path.join(p,'__init__.py')); m = not ie and sys.modules.setdefault('zope',types.ModuleType('zope')); mp = (m or []) and m.__dict__.setdefault('__path__',[]); (p not in mp) and mp.append(p)

It should be easy enough to teach modulegraph about this and insert and empty __init__.py file insite the zip file in the app bundle.

Increasinly-hating-setuptools[*],

   Ronald
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3567 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/pythonmac-sig/attachments/20100730/bce84248/attachment-0001.bin>


More information about the Pythonmac-SIG mailing list