[Distutils] easy_install: #egg taking priority

Phillip J. Eby pje at telecommunity.com
Sat May 13 00:11:52 CEST 2006


At 01:56 PM 5/9/2006 -0500, Ian Bicking wrote:
>So, first the setup.  We wanted to require PIL for a package.  PIL goes
>by the name "PIL" and "Imaging".  Specifically, the file you download is
>named "Imaging", and the actual package installed is named "PIL".  You
>can install Imaging (as long as you use easy_install -f
>http://effbot.org/downloads/) , but it doesn't work as a requirement
>because Imaging itself does not fulfill an Imaging requirement.

Which means the source distribution isn't being produced by the distutils, 
or at any rate is being renamed for distribution.  My suggestion would be 
to redistribute a copy of the package with the correct filename, or ask the 
upstream author to do so.


>So, I figured we'd put in a link like this in someplace listed in -f (we
>have a local set of links we maintain):
>http://effbot.org/downloads/Imaging-1.1.5.tar.gz#egg=PIL-1.1.5
>
>But, this doesn't work.

That's because #egg was added to support SVN source checkouts and 
standalone .py files only.  It's not designed to work on distutils 
distributions.  In particular, using #egg lowers the link precedence so 
that the link is treated as least-preferable unless you're asking for a 
source distribution.  In other words, if there's a non #egg link that meets 
your criteria, easy_install will prefer it to an #egg link.

In short: don't use #egg for this; it's only for non-distutils formats, 
like Subversion checkouts and standalone .py files.


>   easy_install pays attention to
>"Imaging-1.1.5.tar.gz" and ignores the "#egg=..." portion.  This seems
>wrong, since the only reason for #egg to be there is to help
>easy_install, so it should take priority (or both names could be read,
>as long as the #egg info isn't thrown away).

I guess I could add this, but it doesn't make PIL's distribution name any 
less wrong.  Unless the filename is changed, *everybody* will have to use 
#egg links to work around it.  ISTM that this is a case where asking the 
author to distribute it under the matching package name (or to change its 
setup() name to "Imaging") would be the best solution.

But I'll go ahead and add this feature under the theory that it's better to 
always have the ability to tag something explicitly.



More information about the Distutils-SIG mailing list