[Distutils] Puzzling easy_install behavior

Jim Fulton jim at zope.com
Thu Jun 22 17:15:22 CEST 2006


I'd like to share an experiment that I find puzzling and see if anyone
could share some insight. Perhaps I'm doing something incorrectly.

So, I have an links directory:

   [jim at ds9 tmp]$ ls links
   demo-1.0-py2.4.egg  demoneeded-1.0-py2.4.egg  index.html
   [jim at ds9 tmp]$ cat links/index.html
   <html><body>
     <a href="demo-1.0-py2.4.egg">demoneeded-1.0-py2.4.egg</a>
     <a href="demoneeded-1.0-py2.4.egg">demoneeded-1.0-py2.4.egg</a>
   </body></html>

and an empty eggs directory:

   [jim at ds9 tmp]$ ls eggs

Note that demo depends on demoneeded, without any qualifiers.

I run easy_setup (0.6b3):

   [jim at ds9 tmp]$ /usr/local/python/2.4/bin/easy_install -q \
                  -f file:///home/jim/tmp/links/index.html -m -deggs  
demo

and get the eggs I expect.

   [jim at ds9 tmp]$ ls eggs
   demo-1.0-py2.4.egg  demoneeded-1.0-py2.4.egg

I update the links with new versions of demo and demoneeded:

   [jim at ds9 tmp]$ ls links
   demo-1.0-py2.4.egg  demoneeded-1.0-py2.4.egg  index.html
   demo-1.1-py2.4.egg  demoneeded-1.1-py2.4.egg
   [jim at ds9 tmp]$ cat links/index.html
   <html><body>
     <a href="demo-1.0-py2.4.egg">demoneeded-1.0-py2.4.egg</a>
     <a href="demoneeded-1.0-py2.4.egg">demoneeded-1.0-py2.4.egg</a>
     <a href="demo-1.1-py2.4.egg">demoneeded-1.1-py2.4.egg</a>
     <a href="demoneeded-1.1-py2.4.egg">demoneeded-1.1-py2.4.egg</a>
   </body></html>

I haven't changed the unqualified dependence on demoneeded.

Now I rerun easy_install:

   [jim at ds9 tmp]$ /usr/local/python/2.4/bin/easy_install -q \
                  -f file:///home/jim/tmp/links/index.html -m -deggs  
demo

and I get a new demo egg even though I didn't elect to upgrade:

   [jim at ds9 tmp]$ ls eggs
   demo-1.0-py2.4.egg  demo-1.1-py2.4.egg  demoneeded-1.0-py2.4.egg

I find this a bit mysterious.  I thought easy_install wouldn't search
the find links and index if existing distributions meet a requirement
unless --upgrade was used.  Is special consideration given to file
URLs? (If so, this makes test writing a bit more challenging.)

If I supply the upgrade option, I get:

   [jim at ds9 tmp]$ /usr/local/python/2.4/bin/easy_install -q \
                  -f file:///home/jim/tmp/links/index.html -m -U - 
deggs demo
   Couldn't find index page for 'demo' (maybe misspelled?)
   Scanning index of all packages (this may take a while)

   [jim at ds9 tmp]$ ls eggs
   demo-1.0-py2.4.egg  demo-1.1-py2.4.egg  demoneeded-1.0-py2.4.egg

So when I said upgrade, the index was checked, but when I installed
the distributions initially, it wasn't.  Why?  Why is upgrade handled
differently from an initial install.

Also, it's a bit surprising that I didn't get the available upgrade
for demoneeded.  Is that intended?  Are there plans for a recursive
upgrade option?

Jim

--
Jim Fulton			mailto:jim at zope.com		Python Powered!
CTO 				(540) 361-1714			http://www.python.org
Zope Corporation	http://www.zope.com		http://www.zope.org





More information about the Distutils-SIG mailing list