egg-info directory name lacks Python version string

Bug #725178 reported by Chris Lasher
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
distribute (Debian)
Fix Released
Unknown
distribute (Ubuntu)
New
Undecided
Unassigned

Bug Description

For some reason, the version of distribute that ships under the python-setuptools package for Lucid and Maverick creates egg-info directories that lack the Python version string (on Lucid and Maverick, this identifier would be "py2.6"). For example, when installing the Python package yolk version 0.4.1, the egg-info directory created is named "yolk-0.4.1.egg-info" instead of "yolk-0.4.1-py2.6.egg-info". This has created issues with pip; see issue 104:

https://bitbucket.org/ianb/pip/issue/104/pip-uninstall-on-ubuntu-linux

I am trying to understand why the behavior of the version of distribute that ships in the python-setuptools package is inconsistent with the upstream behavior of distribute.

More specifically, I am concerned there may have been Debian/Ubuntu-specific patches applied that have affected the behavior of egg-info directory naming during creation to be simply "PKGNAME-VERSION.egg-info", but that someone also forgot to apply a patch to the method pkg_resources.Distribution.egg_name(), which still provides the "PKGNAME-VERSION-py2.6.egg-info", which is the expected behavior.

description: updated
Revision history for this message
Carl Meyer (carljm) wrote :

Pip uninstall calls the Distribution.egg_name() method, and appends ".egg-info", to determine where to find package metadata. This is precisely the same technique used by setuptools/distribute's install_egg_info command to determine the name of the metadata directory when creating it (see https://bitbucket.org/tarek/distribute/src/f64c2d57df43/setuptools/command/install_egg_info.py). So somehow Ubuntu's packaged version of distribute (python-setuptools) is breaking this symmetry: metadata is installed under an egg-info dir lacking pyversion, but when pip calls the Distribution.egg_name() method it gets a name back that includes pyversion.

This breaks pip uninstall for all users of Ubuntu's python-setuptools package. As far as I can tell there is nothing wrong with what pip is doing here; the breakage is in Ubuntu's package.

Revision history for this message
Syn (synasius) wrote :

Hello everyone, I'm affected by this bug on ubuntu 10.10

I was looking at the sources for the python-setuptools package and I found something interesting:
if you take a look at the diff file included you can see that setuptools/command/install_egg_info.py has been modified
adding the following code to the finalize_options method:

+ if self.install_layout:
+ if not self.install_layout.lower() in ['deb']:
+ raise DistutilsOptionError(
+ "unknown value for --install-layout")
+ basename = basename.replace('-py%s' % pkg_resources.PY_MAJOR, '')
+ elif self.prefix_option or 'real_prefix' in sys.__dict__:
+ # don't modify for virtualenv
+ pass
+ else:
+ basename = basename.replace('-py%s' % pkg_resources.PY_MAJOR, '')

The version string is always replaced, except when you are in a virtualenv (explore site-packages in your virtualenv).
During the uninstall process this kind of replacing is not made in any way, of course.

I'm a little bit confused... anyway, I hope this can help to solve the problem!

Revision history for this message
Carl Meyer (carljm) wrote :

This is an issue in the upstream Debian python-setuptools package. I've discussed it with the Debian maintainer for python-setuptools and filed a bug here: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=618367

Changed in distribute (Debian):
status: Unknown → New
Changed in distribute (Debian):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.