Issue65

Title setuptools bug,inconsistent replacement of eggs when installing from file:// urls.
Priority bug Status resolved
Superseder Nosy List pje, salimfadhley, zooko
Assigned To Keywords

Created on 2009-03-30.14:17:11 by salimfadhley, last changed 2009-10-19.19:28:57 by pje.

Messages
msg417 (view) Author: pje Date: 2009-10-19.19:28:56
setuptools 0.6c10 is released with a fix for this issue.
msg408 (view) Author: zooko Date: 2009-10-14.15:10:07
The following tickets for Tahoe-LAFS may be related.  Hopefully someone will test 
setuptools-0.6c10 with Tahoe-LAFS and report back. 
http://allmydata.org/trac/tahoe/ticket/717 
http://allmydata.org/trac/tahoe/ticket/657
msg380 (view) Author: pje Date: 2009-10-10.22:49:55
This is a bit of a mess.  Basically, the problem is that the PackageIndex object
needs to separately keep track of what distributions are installed or not. 
Precedence isn't enough to do it, and the deferred scanning of URLs doesn't do
it either.
msg254 (view) Author: salimfadhley Date: 2009-03-30.14:17:10
I think I've found a bug in the way that setuptools selects whether an egg
specified by file:// url should be installed over an existing (identical) egg:
 
To re-create the fault:
 
* Install the egg of your choice.
* make two local "egg repositories", one with a very long path (e.g. c:/a/) and
one with a very long path
* In each of the egg repositories place a copy of the egg you just installed,
along with an HTML file containing a link to that egg... just it's filename.
* Try to easy_install the egg with the options "-mv" and set "-f" to either one
of the repositories
 
When you select a short path for the repository you will notice that the egg in
your site_packages folder is always replaced, you see something like this:
 
"Removing
d:\devtools\python24\lib\site-packages\calyon-1.0_r2009_03_12-py2.4-win32.egg"
 
When you select a very long path for the repository you will not see this
message, this is because easy_install leaves the egg unmodified.
 
I've found out why this happens: The pkg_resources.Environment uses a hash-tuple
to work out the order in which to consider packages to install. If you are
trying to install two identical eggs, the 4th element of the tuple
-len(self.location or '') becomes significant... longer URLs get preference to
shorter URLs. 
 
That on it's own might not seem too bad, but consider the the 2nd value of the
hash-tuple (precedence) is given an identical value of 3 both for a package
which is already installed in pkg_resources and a package which can already be
downloaded from a file:// link. I think a better default behaviour would be for
it to give stuff that is already installed a higher precedence than stuff which
could potentially be installed.
History
Date User Action Args
2009-10-19 19:28:57pjesetstatus: in-progress -> resolved
messages: + msg417
2009-10-14 15:10:07zookosetnosy: + zooko
messages: + msg408
2009-10-11 21:49:15pjesetstatus: chatting -> in-progress
2009-10-10 22:49:56pjesetstatus: unread -> chatting
nosy: + pje
messages: + msg380
2009-03-30 14:17:11salimfadhleycreate