[Distutils] use of '_' in package name causing version parsing issue?

Baiju M mbaiju at zeomega.com
Mon Mar 15 09:41:42 CET 2010

Hi Jim,

On Sat, Mar 13, 2010 at 1:38 AM, Jim Fulton <jim at zope.com> wrote:
> On Tue, Mar 9, 2010 at 4:03 PM, Brad Allen <bradallen137 at gmail.com> wrote:
>> Today I was informed of an issue in which buildout (with the latest
>> setuptools) is not resolving version numbers properly, causing the
>> wrong package to be selected in some cases. The cause identified was
>> having '_' in the package name. I am still investigating this issue,
>> but thought it would be worth mentioning on the list in case anyone
>> had a quick answer.
>> Here is the note I received which raised the issue:
> Sorry, I didn't realize that this thread was about buildout.
> Brad, could you send me a simple buildout.cfg (ideally one that
> installs one project) that illustrates the problem and I'll dig into
> it.

I have created a branch to demonstrate the issue:


Please look at this test file: src/zc/buildout/project_name_issue.txt


When I run the test cases like this, I am getting error:

$ ./bin/test -t project_name_issue
Running zope.testing.testrunner.layer.UnitTests tests:
  Set up zope.testing.testrunner.layer.UnitTests in 0.000 seconds.

Failure in test /mnt/a9/wa/zc.buildout/src/zc/buildout/project_name_issue.txt
Failed doctest test for project_name_issue.txt
  File "/mnt/a9/wa/zc.buildout/src/zc/buildout/project_name_issue.txt", line 0

File "/mnt/a9/wa/zc.buildout/src/zc/buildout/project_name_issue.txt",
line 45, in project_name_issue.txt
Failed example:
    print system(buildout),
    Getting distribution for 'foo-bar'.
    Got foo-bar 1.
    Installing foo_bar.
    recipe v1
    Getting distribution for 'foo-bar'.
    Got foo-bar 1.
      Getting section foo_bar.
      Initializing section foo_bar.
      Installing recipe foo_bar.
      Getting distribution for 'foo-bar'.
    Error: Picked: foo-bar = V.V

  Ran 4 tests with 1 failures and 0 errors in 0.720 seconds.
Tearing down left over layers:
  Tear down zope.testing.testrunner.layer.UnitTests in 0.000 seconds.

Baiju M

More information about the Distutils-SIG mailing list