Python EGG for 0.6 uploaded to PyPI

3 views
Skip to first unread message

David Moss

unread,
Feb 1, 2009, 5:22:44 PM2/1/09
to netaddr
Hi,

As part of 0.6 I provided setup_egg.py, a setuptools specific script
to create Python EGGs. I've taken the additional step of tweaking it
and I've now uploaded a Python 2.5 version of the egg to PyPI.

Sebastien, I believe you raised the initial ticket for this so would
you please test it and provide feedback when you get a chance?

Many thanks,

David Moss

Sebastien Douche

unread,
Feb 1, 2009, 5:45:15 PM2/1/09
to net...@googlegroups.com

seb@wiener:~/tmp$ virtualenv --no-site-packages --clear testnetaddr
Not deleting testnetaddr/bin
New python executable in testnetaddr/bin/python2.5
Also creating executable in testnetaddr/bin/python
Installing setuptools............done.
seb@wiener:~/tmp$ cd testnetaddr/
seb@wiener:~/tmp/testnetaddr$ ./bin/easy_install netaddr
Searching for netaddr
Reading http://pypi.python.org/simple/netaddr/
Reading http://code.google.com/p/netaddr/
Reading http://code.google.com/p/netaddr/downloads/list
Reading http://netaddr.googlecode.com/
Best match: netaddr 0.6
Downloading http://pypi.python.org/packages/2.5/n/netaddr/netaddr-0.6-py2.5.egg#md5=35ca3ddbb4e5686cfc33ba051f26879f
Processing netaddr-0.6-py2.5.egg
Moving netaddr-0.6-py2.5.egg to
/home/seb/tmp/testnetaddr/lib/python2.5/site-packages
Adding netaddr 0.6 to easy-install.pth file

Installed /home/seb/tmp/testnetaddr/lib/python2.5/site-packages/netaddr-0.6-py2.5.egg
Processing dependencies for netaddr
Finished processing dependencies for netaddr
seb@wiener:~/tmp/testnetaddr$ ./bin/python
Python 2.5.2 (r252:60911, Oct 5 2008, 19:24:49)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import netaddr
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/seb/tmp/testnetaddr/lib/python2.5/site-packages/netaddr-0.6-py2.5.egg/netaddr/__init__.py",
line 58, in <module>
File "/home/seb/tmp/testnetaddr/lib/python2.5/site-packages/netaddr-0.6-py2.5.egg/netaddr/address.py",
line 20, in <module>
File "/home/seb/tmp/testnetaddr/lib/python2.5/site-packages/netaddr-0.6-py2.5.egg/netaddr/eui/__init__.py",
line 503, in <module>
File "/home/seb/tmp/testnetaddr/lib/python2.5/site-packages/netaddr-0.6-py2.5.egg/netaddr/eui/__init__.py",
line 487, in load_ieee_indices
IOError: [Errno 20] Not a directory:
'/home/seb/tmp/testnetaddr/lib/python2.5/site-packages/netaddr-0.6-py2.5.egg/netaddr/eui/oui.idx'
>>>

Haven't got time to investige now.

--
Sebastien Douche <sdo...@gmail.com>

DrKJam

unread,
Feb 2, 2009, 9:45:17 AM2/2/09
to net...@googlegroups.com
2009/2/1 Sebastien Douche <sdo...@gmail.com>
Ouch! I can see what is happening here, but I don't currently know how about the best way to get around it at this point.

I've raised a ticket to track this - http://code.google.com/p/netaddr/issues/detail?id=27
 
Basically I'm storing some data files in a path below netaddr's top level module directory which are parsed when the netaddr module is loaded. Unfortunately this breaks when you use eggs because these data files are stored in an egg zip file rather than on the filesystem. A normal file access operation obviously fails because the path is not found. setuptools must have some hooks that intercept your module loads and magically dig inside the zip file to return the required files.

I'm probably not going about storing the data files published with 0.6 in the correct way. Anyone have any ideas about 'the right way' to publish data files with your Python code to help get around this problem?

I knew eggs were going to be trouble ;-)

PS - BTW, thanks for making me look up and install virtualenv. I've been meaning to look at it for a while and it is totally ace ;-)

David Moss

unread,
Feb 2, 2009, 12:10:07 PM2/2/09
to netaddr
I've removed the 0.6 egg package from PyPI for now as it is broken and
has already had 9 downloads (ouch)!

David Moss

unread,
Feb 2, 2009, 6:03:40 PM2/2/09
to netaddr
On Feb 2, 5:10 pm, David Moss <drk...@gmail.com> wrote:
> I've removed the 0.6 egg package from PyPI for now as it is broken and
> has already had 9 downloads (ouch)!

New egg uploaded that should now work correctly. The only change I
made in the end was setting the zip_safe=False option. This means that
easy_install extracts the .egg to filesystem instead of keeping it in
zip file. I didn't get any module errors this time and the data
lookups seem to be working fine.

Sadly, this has meant a change of MD5 checksums on the package :-

35ca3ddbb4e5686cfc33ba051f26879f (previous bad release that was
removed)
d5fe67ddfc227ce126536b5e7656bd20 (current good release now on PyPI)

Not really sure if I should have bumped up to 0.6.1 but that seemed
like overkill.

I had to go in and delete the .egg manually from the site-packages
directory in my virtualenv environment before easy_install would pull
down the updated egg package (a bit ugly).

Thanks go to Diez Roggisch on comp.lang.python for pointing out the
error of my ways.

Apologies for the hassle - I should have really tested this before I
allowing it out the gate.

Sebastien, it would be great to get a +1 from you that the updated
release package works for you as well.

I really wish the setuptools documentation was a lot better!

Dave M.
Reply all
Reply to author
Forward
0 new messages