Re: [Distutils] buildout-versions not showing pinned versions

2011-08-17 Thread Maurits van Rees

Op 17-08-11 05:32, B.Nanda Kishore schreef:

Well that was something new for me. Having two versions of the same
package in
the same buildout file.

Actually I was installing a few distributions in my workplace. So some
distros have
version pinned in their setup.py install_requires section, and when I
run the buildout
expecting the versions to be printed, its not printing those alone. So
mentioning the version
was not in the buildout file originally, but I see your point of putting
them in [versions] section.
But tell me this. In the above example(pinning a version number in
install_requires section of setup.py)
expecting the version of the package to be printed is a valid usecase
right ? Is it not ? I know from the
example which you gave previously there seems to be some ambiguity from
which version to pick if
there are multiple versions. right ? Thats why its left out or ?


The goal of buildout-versions (or its cousin 
buildout.dumppickedversions) is to list all packages that are not 
pinned.   When a package is not pinned, buildout picks the most recent 
version.  That may work today and fail horribly tomorrow if this 
unpinned package is updated in backwards incompatible ways.


If buildout-versions prints anything I consider this an error in my 
buildout.  If I agree the correct versions have been picked I add the 
printed versions to the [versions] section, rerun the buildout and now 
buildout-versions should not print anything anymore.


In other words: buildout-versions does not print all versions, just the 
not-pinned ones that buildout has picked.  Like Chris said, this is 
intentional.



--
Maurits van Rees
Web App Programmer at Zest Software: http://zestsoftware.nl
Personal website: http://maurits.vanrees.org/

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


Re: [Distutils] buildout-versions not showing pinned versions

2011-08-17 Thread Fred Drake
On Tue, Aug 16, 2011 at 10:14 PM, Chris Withers ch...@simplistix.co.uk wrote:
 *Why* are you pinning in the eggs line?

At Zope, we've had to do this when different processes constructed by a build
had to use different versions of libraries.  buildout-versions aside, it's not
that unusual a case.


  -Fred

-- 
Fred L. Drake, Jr.    fdrake at acm.org
A person who won't read has no advantage over one who can't read.
   --Samuel Langhorne Clemens
___
Distutils-SIG maillist  -  Distutils-SIG@python.org
http://mail.python.org/mailman/listinfo/distutils-sig


Re: [Distutils] buildout-versions not showing pinned versions

2011-08-17 Thread Chris Withers

On 17/08/2011 05:40, Fred Drake wrote:

On Tue, Aug 16, 2011 at 10:14 PM, Chris Withersch...@simplistix.co.uk  wrote:

*Why* are you pinning in the eggs line?


At Zope, we've had to do this when different processes constructed by a build
had to use different versions of libraries.  buildout-versions aside, it's not
that unusual a case.


Indeed, I believe I did explain that usecase ;-)

Myself, I'd just use multiple buildouts, and I don't think I've ever 
bumped into the situation you're describing, but nonetheless, if you've 
pinned the version some other way, then buildout-versions won't tell you 
that it hasn't been pinned...


cheers,

Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
- http://www.simplistix.co.uk
___
Distutils-SIG maillist  -  Distutils-SIG@python.org
http://mail.python.org/mailman/listinfo/distutils-sig


Re: [Distutils] buildout-versions not showing pinned versions

2011-08-17 Thread Chris Withers

On 16/08/2011 20:32, B.Nanda Kishore wrote:

Actually I was installing a few distributions in my workplace. So some
distros have
version pinned in their setup.py install_requires section,


This is pretty evil. Why on earth are you doing this?
You should only ever place version limits in install_requires, and even 
then, only if there are compatibility issues with a library a package 
depends on.


eg: install_requries=['SomePackage  2.0']


and when I
run the buildout
expecting the versions to be printed,


For the third time, why are you expecting versions to be printed here?
You've pinned the version required, so buildout-versions won't report it 
as unpinned...



But tell me this. In the above example(pinning a version number in
install_requires section of setup.py)
expecting the version of the package to be printed is a valid usecase
right ?


Wrong.


Is it not ?


No, it is not.

cheers,

Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
- http://www.simplistix.co.uk
___
Distutils-SIG maillist  -  Distutils-SIG@python.org
http://mail.python.org/mailman/listinfo/distutils-sig


Re: [Distutils] buildout-versions not showing pinned versions

2011-08-16 Thread Chris Withers

Hi,

I've CC'ed in the correct mailing list for these discussions, you should 
mail there first in future.


Right, replaying our discussion in it's original order:

 On 13/08/2011 04:04, B.Nanda Kishore wrote:

 when my buildout.cfg is having content like:
 *[buildout]*
 *parts = deps*
 *extensions = buildout-versions*
 *
 *
 *[deps]*
 *recipe = zc.recipe.egg*
 *eggs = Django*

 and when I run buildout its printing the latest Django 
version(1.3).

 Thats fine. But.
 when I pin the version number of Django in buildout.cfg to 
something


Okay, so it looks like you're pinning versions as follows:

On 15/08/2011 06:20, B.Nanda Kishore wrote:
 Here is my buildout.cfg:
 [buildout]
 parts = deps
 extensions = buildout-versions

 [deps]
 recipe = zc.recipe.egg
 eggs = *Django==1.0.4*

As an aside, I'll point out that the above buildout.cfg doesn't do 
anything useful as Django doesn't expose any setuptools-style console 
scripts.


Now, buildout-versions won't report any versions here since you've 
pinned Django to 1.0.4. It only warns about un-pinned versions of eggs.


Here's a minimal useful recipe that pins Django in a more orthodox 
fashion and provides a bin/py interpreter that will that version 1.0.4 
of django available:


[buildout]
parts = deps
extensions = buildout-versions
versions = versions

[versions]
buildout-versions = 1.6
Django = 1.0.4
setuptools = 0.6c12dev-r88846
zc.buildout = 1.5.2
zc.recipe.egg = 1.3.2

[deps]
recipe = zc.recipe.egg
eggs = Django
interpreter = py

However, I'd suggest looking at the djangorecipe package as a much more 
useful way of dealing with Django in buildout!


cheers,

Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
- http://www.simplistix.co.uk
___
Distutils-SIG maillist  -  Distutils-SIG@python.org
http://mail.python.org/mailman/listinfo/distutils-sig


Re: [Distutils] buildout-versions not showing pinned versions

2011-08-16 Thread B.Nanda Kishore
Its not just with Django. I have faced the same problem with a different
custom package
also. I have developed two sample packages(having just a setup.py with name
and version mentioned)
and I have tried installing both those packages using buildout. One of those
packages version number is pinned.
Here is the buildout.cfg

[buildout]
index=http://localhost:8000/
parts = deps
extensions = buildout-versions

[deps]
recipe = zc.recipe.egg
eggs = PkgA
PkgB==0.1.0

When I ran the buildout, this is the output I got.

[versions]
PkgA = 0.1.0
buildout-versions = 1.6
distribute = 0.6.19
zc.buildout = 1.5.2
zc.recipe.egg = 1.3.2

Notice that PkgB's version is not printed. My doubt was regarding the
Line#33 in 
buildout-versions/__init__.pyhttps://github.com/Simplistix/buildout-versions/blob/master/src/buildout_versions/__init__.py#L33.
That is the one which is filtering
the pinned distributions. I wanted to know why is it doing it ?

Regards,
Nandakishore


On Tue, Aug 16, 2011 at 8:20 PM, Chris Withers ch...@simplistix.co.ukwrote:

 Hi,

 I've CC'ed in the correct mailing list for these discussions, you should
 mail there first in future.

 Right, replaying our discussion in it's original order:


  On 13/08/2011 04:04, B.Nanda Kishore wrote:
 
  when my buildout.cfg is having content like:
  *[buildout]*
  *parts = deps*
  *extensions = buildout-versions*
  *
  *
  *[deps]*
  *recipe = zc.recipe.egg*
  *eggs = Django*
 
  and when I run buildout its printing the latest Django
 version(1.3).
  Thats fine. But.
  when I pin the version number of Django in buildout.cfg to
 something

 Okay, so it looks like you're pinning versions as follows:


 On 15/08/2011 06:20, B.Nanda Kishore wrote:
  Here is my buildout.cfg:
  [buildout]
  parts = deps
  extensions = buildout-versions
 
  [deps]
  recipe = zc.recipe.egg
  eggs = *Django==1.0.4*

 As an aside, I'll point out that the above buildout.cfg doesn't do anything
 useful as Django doesn't expose any setuptools-style console scripts.

 Now, buildout-versions won't report any versions here since you've pinned
 Django to 1.0.4. It only warns about un-pinned versions of eggs.

 Here's a minimal useful recipe that pins Django in a more orthodox fashion
 and provides a bin/py interpreter that will that version 1.0.4 of django
 available:


 [buildout]
 parts = deps
 extensions = buildout-versions
 versions = versions


 [versions]
 buildout-versions = 1.6
 Django = 1.0.4
 setuptools = 0.6c12dev-r88846

 zc.buildout = 1.5.2
 zc.recipe.egg = 1.3.2

 [deps]
 recipe = zc.recipe.egg
 eggs = Django
 interpreter = py

 However, I'd suggest looking at the djangorecipe package as a much more
 useful way of dealing with Django in buildout!


 cheers,

 Chris

 --
 Simplistix - Content Management, Batch Processing  Python Consulting
- http://www.simplistix.co.uk

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


Re: [Distutils] buildout-versions not showing pinned versions

2011-08-16 Thread Chris Withers

On 16/08/2011 18:31, B.Nanda Kishore wrote:

[buildout]
index=http://localhost:8000/
parts = deps
extensions = buildout-versions

[deps]
recipe = zc.recipe.egg
eggs = PkgA
 PkgB==0.1.0

When I ran the buildout, this is the output I got.

[versions]
PkgA = 0.1.0
buildout-versions = 1.6
distribute = 0.6.19
zc.buildout = 1.5.2
zc.recipe.egg = 1.3.2

Notice that PkgB's version is not printed.


Yes, as I said before, this is intended and will not change.

Here's an example buildout.cfg that shows why:

[buildout]
parts = part1 part2
extensions = buildout-versions
versions = versions

[versions]
SomePackage = 2.0

[part1]
recipe = zc.recipe.egg
eggs =
  SomePackage

[part2]
recipe = zc.recipe.egg
eggs =
  SomeOtherPackage
  SomePackage==1.0

To explain, SomeOtherPackage has a dependency on SomePackage, but hasn't 
been updated to work with version 2.0, so needs to be pinned to 1.0. 
However, the rest of the buildout is fine to use with the new version 2.0.


In general, buildout-versions should be used as described in its docs 
and versions should *only* be pinned in a [versions] section.


*Why* are you pinning in the eggs line?

cheers,

Chris

--
Simplistix - Content Management, Batch Processing  Python Consulting
- http://www.simplistix.co.uk
___
Distutils-SIG maillist  -  Distutils-SIG@python.org
http://mail.python.org/mailman/listinfo/distutils-sig


Re: [Distutils] buildout-versions not showing pinned versions

2011-08-16 Thread B.Nanda Kishore
Well that was something new for me. Having two versions of the same package
in
the same buildout file.

Actually I was installing a few distributions in my workplace. So some
distros have
version pinned in their setup.py install_requires section, and when I run
the buildout
expecting the versions to be printed, its not printing those alone. So
mentioning the version
was not in the buildout file originally, but I see your point of putting
them in [versions] section.
But tell me this. In the above example(pinning a version number in
install_requires section of setup.py)
expecting the version of the package to be printed is a valid usecase right
? Is it not ? I know from the
example which you gave previously there seems to be some ambiguity from
which version to pick if
there are multiple versions. right ? Thats why its left out or ?

Regards,
Nandakishore


On Wed, Aug 17, 2011 at 7:44 AM, Chris Withers ch...@simplistix.co.ukwrote:

 On 16/08/2011 18:31, B.Nanda Kishore wrote:

 [buildout]
 index=http://localhost:8000/
 parts = deps
 extensions = buildout-versions

 [deps]
 recipe = zc.recipe.egg
 eggs = PkgA
 PkgB==0.1.0

 When I ran the buildout, this is the output I got.

 [versions]
 PkgA = 0.1.0
 buildout-versions = 1.6
 distribute = 0.6.19
 zc.buildout = 1.5.2
 zc.recipe.egg = 1.3.2

 Notice that PkgB's version is not printed.


 Yes, as I said before, this is intended and will not change.

 Here's an example buildout.cfg that shows why:

 [buildout]
 parts = part1 part2

 extensions = buildout-versions
 versions = versions

 [versions]
 SomePackage = 2.0

 [part1]

 recipe = zc.recipe.egg
 eggs =
  SomePackage

 [part2]

 recipe = zc.recipe.egg
 eggs =
  SomeOtherPackage
  SomePackage==1.0

 To explain, SomeOtherPackage has a dependency on SomePackage, but hasn't
 been updated to work with version 2.0, so needs to be pinned to 1.0.
 However, the rest of the buildout is fine to use with the new version 2.0.

 In general, buildout-versions should be used as described in its docs and
 versions should *only* be pinned in a [versions] section.

 *Why* are you pinning in the eggs line?


 cheers,

 Chris

 --
 Simplistix - Content Management, Batch Processing  Python Consulting
- http://www.simplistix.co.uk

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