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

2017-02-24 Thread Jim Fulton
On Fri, Feb 24, 2017 at 6:59 AM, Paul Moore  wrote:

> On 24 February 2017 at 11:54, Lele Gaifax  wrote:
> > Paul Moore  writes:
> >
> >> On 24 February 2017 at 11:37, Lele Gaifax  wrote:
> >>> Can anyone shed some light on the problem? By what logic buildout used
> a
> >>> different name for that particular package?
> >>
> >> While I don't know anything about buildout, pyramid-tm is the
> >> normalised version of pyramid_tm - see
> >> https://www.python.org/dev/peps/pep-0503/#normalized-names
> >
> > Oh, I see, thank you. Does that mean that the right thing I should do is
> > always using such normalized names in my requirements.txt/versions.cfg?
>
> I *think* it shouldn't matter. The problem will likely be with older
> tools not normalising. So using normalised names throughout might help
> such tools.
>

Thanks Paul.  Yes, this is a buildout bug:

https://github.com/buildout/buildout/issues/317

This case shed the light on the bug for me. Thanks.

Jim

-- 
Jim Fulton
http://jimfulton.info
___
Distutils-SIG maillist  -  Distutils-SIG@python.org
https://mail.python.org/mailman/listinfo/distutils-sig


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

2017-02-24 Thread Paul Moore
On 24 February 2017 at 11:54, Lele Gaifax  wrote:
> Paul Moore  writes:
>
>> On 24 February 2017 at 11:37, Lele Gaifax  wrote:
>>> Can anyone shed some light on the problem? By what logic buildout used a
>>> different name for that particular package?
>>
>> While I don't know anything about buildout, pyramid-tm is the
>> normalised version of pyramid_tm - see
>> https://www.python.org/dev/peps/pep-0503/#normalized-names
>
> Oh, I see, thank you. Does that mean that the right thing I should do is
> always using such normalized names in my requirements.txt/versions.cfg?

I *think* it shouldn't matter. The problem will likely be with older
tools not normalising. So using normalised names throughout might help
such tools.
Paul
___
Distutils-SIG maillist  -  Distutils-SIG@python.org
https://mail.python.org/mailman/listinfo/distutils-sig


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

2017-02-24 Thread Lele Gaifax
Paul Moore  writes:

> On 24 February 2017 at 11:37, Lele Gaifax  wrote:
>> Can anyone shed some light on the problem? By what logic buildout used a
>> different name for that particular package?
>
> While I don't know anything about buildout, pyramid-tm is the
> normalised version of pyramid_tm - see
> https://www.python.org/dev/peps/pep-0503/#normalized-names

Oh, I see, thank you. Does that mean that the right thing I should do is
always using such normalized names in my requirements.txt/versions.cfg?

ciao, lele.
-- 
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
l...@metapensiero.it  | -- Fortunato Depero, 1929.

___
Distutils-SIG maillist  -  Distutils-SIG@python.org
https://mail.python.org/mailman/listinfo/distutils-sig


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

2017-02-24 Thread Paul Moore
On 24 February 2017 at 11:37, Lele Gaifax  wrote:
> Can anyone shed some light on the problem? By what logic buildout used a
> different name for that particular package?

While I don't know anything about buildout, pyramid-tm is the
normalised version of pyramid_tm - see
https://www.python.org/dev/peps/pep-0503/#normalized-names

Your two setups may be behaving differently regarding normalisation
(I'd suspect the older version wasn't normalising correctly - it's a
relatively new change).
Paul
___
Distutils-SIG maillist  -  Distutils-SIG@python.org
https://mail.python.org/mailman/listinfo/distutils-sig


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

2017-02-24 Thread Lele Gaifax
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.
l...@metapensiero.it  | -- Fortunato Depero, 1929.

___
Distutils-SIG maillist  -  Distutils-SIG@python.org
https://mail.python.org/mailman/listinfo/distutils-sig