[Distutils] Issue with (latest?) buildout and package name containing underscore

Lele Gaifax lele at metapensiero.it
Fri Feb 24 06:37:17 EST 2017


Hi all,

I have a installation setup of an application of mine that uses zc.buildout
(see #1). Today I had to reinstall it on a new machine, using Python
3.6. Executing its bootstrap.py installed latest zc.buildout (2.8.0).

All the required packages are pinned to an exact version (see #2), so it
surprised me to hit the following error executing the buildout:

    Version and requirements information containing transaction:
      [versions] constraint on transaction: 1.4.4
      Requirement of SoL==3.37: transaction
      Requirement of zope.sqlalchemy: transaction
      Requirement of transaction: zope.interface
      Requirement of pyramid_tm: transaction>=2.0
    While:
      Installing sol.
    Error: The requirement ('transaction>=2.0') is not allowed by your [versions] constraint (1.4.4)

Investigating the issue, I found that buildout was actually installing
“pyramid-tm” (with a dash), not “pyramid_tm” (underscore, the only one present
on PyPI, see #3):

    ...
    Getting distribution for 'pyramid_tm'.
    Got pyramid-tm 1.1.1.
    ...

And that of course is the source of the problem: hacking a local copy of the
versions.cfg adding the following line:

    pyramid-tm = 0.12.1
    
and then adjusting the buildout.cfg to load that local copy fixed the problem.

So the question is: what is the real nature of the problem?

I downloaded current pyramid_tm sources, and there is no trace of a
“pyramid-tm” except in the project's URL:

    $ git grep pyramid-tm
    setup.py:      url="http://docs.pylonsproject.org/projects/pyramid-tm/en/latest/",

but effectively when I dig inside the egg that buildout produced I can find
the following:

    $ grep -r pyramid-tm *
    EGG-INFO/PKG-INFO:Name: pyramid-tm
    EGG-INFO/PKG-INFO:Home-page: http://docs.pylonsproject.org/projects/pyramid-tm/en/latest/

The differences since my last install-from-scratch of the application (that
worked flawlessly) are basically version 3.6 of Python and version 2.8.0 of
zc.buildout.

Can anyone shed some light on the problem? By what logic buildout used a
different name for that particular package?

Thank you in advance,
ciao, lele.

#1 https://bitbucket.org/lele/solista
#2 https://bitbucket.org/lele/sol/raw/master/requirements/versions.cfg
#3 https://pypi.python.org/pypi/pyramid_tm
-- 
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
lele at metapensiero.it  |                 -- Fortunato Depero, 1929.



More information about the Distutils-SIG mailing list