[Distutils] Broken setuptools again?

Phillip J. Eby pje at telecommunity.com
Sun Sep 18 21:08:14 CEST 2005

At 11:05 AM 9/18/2005 -0700, Ben Bangert wrote:
>For example, in the 0.6a2 upgrade, it seems the easy_install script
>wasn't updated or something. So now easy_install.pth was updated to
>refer to the new setuptools version, but easy_install.py itself was
>not. This results in this message:
>infopkg_resources.VersionConflict: (setuptools 0.6a2 (/Library/ 
>setuptools-0.6a2-py2.4.egg), Requirement.parse('setuptools==0.6a1'))
>The first line of traceback is more revealing:
>Traceback (most recent call last):  File "/usr/local/bin/ 
>easy_install.py", line 4, in ?    pkg_resources.run_script 
>('setuptools==0.6a1', 'easy_install.py')
>Sure enough, the script wasn't updated during the setuptools 0.6a1 ->
>0.6a2 upgrade. As such, easy_install is currently broken on my system
>and completely unusable.

That's because 'easy_install.py' is no longer the script that runs 
EasyInstall.  It's 'easy_install' now, with no extension, as described in 
the current documentation.

This is probably not as clear as it should have been; this was based on a 
very new feature, and honestly I forgot about the upgrade scenario, and the 
fact that existing EasyInstall users would be accustomed to running 
easy_install.py instead.  (Especially since on Windows, an easy_install.py 
is still generated alongside the new easy_install.exe file.)

I'll release 0.6a3 with an easy_install.py script that tells you to run 
'easy_install' instead.  (I did think of the "python -m easy_install" case, 
and if you run that it'll tell you to run it the new way.)

>As I'm working on several Python programs, I've been pondering using
>setuptools for their distro as I want the functionality it has but
>I'm not ready to be sending users to something that breaks so often
>(at least in my moderate usage attempts). When do you expect a
>"Stable" release? Any ideas how I can fix my problem so I can use
>setuptools again?

Current versions of setuptools are maintained on the cheeseshop servers 
more or less indefinitely, so you should be able to just freeze what 
version of ez_setup.py you use by including it directly in your 
package.  Unfortunately, the cheeseshop changed its download locations 
recently, and broke backward compatibility with existing copies of 
ez_setup.  Hopefully this won't happen again, although I have no control 
over it.

As for a stable release, all I can say is that setuptools' API stability is 
now pretty good, and I don't expect any significant changes.  Hopefully, 
everything from here on out should be new features, and hopefully they will 
be add-ons rather than things needing to be grafted into the basic 
structure.  Setuptools tends to use its own new features first, however, 
and the problem you experienced with 0.6a2 is an example.

I don't take this to mean that 0.6a2 is broken, however.  If you were 
installing 0.6a2 fresh, you wouldn't have had the problem that you 
did.  It's less of a problem with stability per se, than with having robust 
upgrades.  In the long run, we should have a package management tool that 
can deal with things like removing outdated scripts, but we don't have one 
now.  If by "stable" you mean that setuptools doesn't have any bugs, then 
at this point the most "stable" releases are 0.5a13, 0.6a1, and 
0.6a2.  They do what they do, although each version has features that the 
earlier ones don't.  0.5a13 in particular has a wealth of limitations 
compared to the 0.6 releases, and the main reason there were so many 
releases in the 0.5 line is that it *was* unstable.  There was quite a bit 
of reorganization of the installation process happening there.  Because of 
the many problems with 0.5, the 0.6a1 release was developed in CVS without 
making interim releases to PyPI or updating the svn:externals ez_setup, 
precisely to avoid having these kinds of problems.

So, I guess what I'm saying is that you have a couple of options regarding 
how you want to embed setuptools.  You can use svn:externals, in which case 
you'll be getting only releases judged to be of moderately stable 
quality.  There were several points between 0.5a13 and 0.6a1 (such as the 
two 0.6a1 candidate releases) that I did *not* update the svn:externals 
ez_setup, so that folks like yourself wouldn't end up accidentally 
participating in the testing.  :)

However, if you want to personally vet the versions you use with your 
package, you should be able to just keep a personal copy of ez_setup.py, 
and even modify it for your own use.  Heck, you don't even have to modify 
it or keep such a version, because the 'use_setuptools()' function takes a 
version and a download base URL.  You can save a copy of the setuptools 
eggs you want to use, and simply set the version and download base in your 
setup script.  So, you don't have to depend on anybody else to keep the 
version you want available.

So, to put a different spin on your question...  you can determine what 
*you* consider to be a stable release of setuptools, and make your system 
use that.  :)

(It's true that if someone already has a newer version of setuptools, 
that's what will be used instead.  However, that's *their* responsibility, 
and they can and should bitch to me if something breaks.)

More information about the Distutils-SIG mailing list