[Distutils] Setuptools projects with '-' in their names (was Re: some kind of problem with setuptools 0.6a9)

Phillip J. Eby pje at telecommunity.com
Fri Dec 30 17:51:44 CET 2005

At 10:04 AM 12/30/2005 -0500, Kevin Dangoor wrote:
>The "tg-admin sql" command uses sqlobject which, in turn uses egg
>metadata. Something I just noticed is that these commands are no
>longer working on a project i have called "Wiki-20". They *used* to
>work. Now they get a "DistributionNotFound" error for Wiki-20.
>I had also tried to just do "pkg_resources.require("WIki-20")" from
>the Python shell, but that didn't work either. This is new behavior
>between a8 and a9. Let me know if there's anything else I can tell you
>about the problem...

Hi all.  Due to the recent addition of versioned '.egg-info' support for 
system packages, you may have to rename any current '.egg-info' if your 
project name has a '-' in it.  Otherwise, recent versions of setuptools 
will think the '-' is the separator between the project name and version 
number, leading to problems like the ones described by Kevin above.

I've added code to the latest SVN setuptools to detect this problem and 
warn you about it, as well as tell you what you should rename the .egg-info 
directory to.

If you have a '-' in your project's name, and you are using an 0.6a9dev 
version of setuptools, you should upgrade and rename the .egg-info 
directory.  If you distribute any source releases of your project or have 
users tracking SVN or CVS releases of it, you *must* make your project 
require setuptools>=0.6a9dev_r41857, by passing it to ez_setup, e.g.::

     from ez_setup import use_setuptools

If you do not do this, and a user has an older version of setuptools, they 
will encounter problems.

If you wait for the official release of 0.6a9 to upgrade, and you use its 
ez_setup.py or ez_setup/__init__.py, you can avoid having to change the 
setup script as shown.

Again, all this applies only to projects with a '-' in their names, and 
only if *you* are upgrading from 0.6a8 to an 0.6a9 development or final 
release.  Your project's users can upgrade to 0.6a9 without breakage, as 
there is a backward compatibility mode for everything but "setup.py 
develop" (which will refuse to run until the .egg-info directory has been 

More information about the Distutils-SIG mailing list