why this version spec does not work?

Hello,
I have here this version spec in setup.py: 'zope.testing >=3.6.0,<3.10.0',
but zc.buildout does not get it right. Source is here: svn://svn.zope.org/repos/main/zc.recipe.testrunner/branches/1.2.1 Output is here: http://paste.lisp.org/+2FSQ
Why on earth does zc.buildout pick zope.testing = 3.10.0 with the above spec??

At 06:46 PM 8/23/2010 +0200, Adam GROSZER wrote:
Hello,
I have here this version spec in setup.py: 'zope.testing >=3.6.0,<3.10.0',
but zc.buildout does not get it right. Source is here: svn://svn.zope.org/repos/main/zc.recipe.testrunner/branches/1.2.1 Output is here: http://paste.lisp.org/+2FSQ
Why on earth does zc.buildout pick zope.testing = 3.10.0 with the above spec??
That's really odd; it must be something in buildout, as setuptools' Requirement objects seem to do the right thing:
from pkg_resources import Requirement, parse_version r=Requirement.parse('zope.testing >=3.6.0,<3.10.0') '3.6' in r
True
'3.10' in r
False
'3.10.0' in r
False

On Mon, Aug 23, 2010 at 12:46 PM, Adam GROSZER agroszer@gmail.com wrote:
Hello,
I have here this version spec in setup.py: 'zope.testing >=3.6.0,<3.10.0',
but zc.buildout does not get it right. Source is here: svn://svn.zope.org/repos/main/zc.recipe.testrunner/branches/1.2.1 Output is here: http://paste.lisp.org/+2FSQ
Why on earth does zc.buildout pick zope.testing = 3.10.0 with the above spec??
If you look earlier in the output you provide a link to, buildout does get it right. It picks 3.9.5.
Then, when zc.recipe.testrunner runs, it tries to load zope.testing explicitly:
eggs, ws = self.egg.working_set(('zope.testing', ))
It doesn't restrict the version here. This didn't cause a problem until you added the restriction in in setup.py.
Anyone not interested in the implementation of zc.recipe.testrunner should stop reading here, if you haven't already. :)
self.egg implies zc.recipe.testrunner, so the low-level buildout APIs are asked to create a working set for zc.recipe.testrunner and zope.testing. It happens to load packages in a breadth first order and gets the newest version of zope.testing before it tries to get the restricted dependency of zc.recipe.testrunner.
The easiest way to fix this is to remove the redundant and now incorrect reference to zope.testing in the call to self.egg.working_set:
eggs, ws = self.egg.working_set()
Jim
-- Jim Fulton

Hello Jim,
Monday, August 23, 2010, 8:48:16 PM, you wrote:
JF> On Mon, Aug 23, 2010 at 12:46 PM, Adam GROSZER agroszer@gmail.com wrote:
Hello,
I have here this version spec in setup.py: 'zope.testing >=3.6.0,<3.10.0',
but zc.buildout does not get it right. Source is here: svn://svn.zope.org/repos/main/zc.recipe.testrunner/branches/1.2.1 Output is here: http://paste.lisp.org/+2FSQ
Why on earth does zc.buildout pick zope.testing = 3.10.0 with the above spec??
JF> If you look earlier in the output you provide a link to, buildout does JF> get it right. It picks 3.9.5.
JF> Then, when zc.recipe.testrunner runs, it tries to load zope.testing JF> explicitly:
JF> eggs, ws = self.egg.working_set(('zope.testing', ))
JF> It doesn't restrict the version here. This didn't cause a problem JF> until you added the restriction in in setup.py.
JF> Anyone not interested in the implementation of zc.recipe.testrunner should JF> stop reading here, if you haven't already. :)
JF> self.egg implies zc.recipe.testrunner, so the low-level buildout APIs JF> are asked to create a working set for zc.recipe.testrunner and JF> zope.testing. It happens to load packages in a breadth first order JF> and gets the newest version of zope.testing before it tries to get the JF> restricted dependency of zc.recipe.testrunner.
JF> The easiest way to fix this is to remove the redundant and now JF> incorrect reference to zope.testing in the call to JF> self.egg.working_set:
JF> eggs, ws = self.egg.working_set()
Thanks for the pointer, but in my case it seems to work only with the version spec added:
eggs, ws = self.egg.working_set(('zope.testing <3.10.0', ))
If I do
eggs, ws = self.egg.working_set()
zope.testing seems to be missed from the test script entirely.

On Tue, Aug 24, 2010 at 10:31 AM, Adam GROSZER agroszer@gmail.com wrote:
Hello Jim,
Monday, August 23, 2010, 8:48:16 PM, you wrote:
JF> On Mon, Aug 23, 2010 at 12:46 PM, Adam GROSZER agroszer@gmail.com wrote:
Hello,
I have here this version spec in setup.py: 'zope.testing >=3.6.0,<3.10.0',
but zc.buildout does not get it right. Source is here: svn://svn.zope.org/repos/main/zc.recipe.testrunner/branches/1.2.1 Output is here: http://paste.lisp.org/+2FSQ
Why on earth does zc.buildout pick zope.testing = 3.10.0 with the above spec??
JF> If you look earlier in the output you provide a link to, buildout does JF> get it right. It picks 3.9.5.
JF> Then, when zc.recipe.testrunner runs, it tries to load zope.testing JF> explicitly:
JF> eggs, ws = self.egg.working_set(('zope.testing', ))
JF> It doesn't restrict the version here. This didn't cause a problem JF> until you added the restriction in in setup.py.
JF> Anyone not interested in the implementation of zc.recipe.testrunner should JF> stop reading here, if you haven't already. :)
JF> self.egg implies zc.recipe.testrunner, so the low-level buildout APIs JF> are asked to create a working set for zc.recipe.testrunner and JF> zope.testing. It happens to load packages in a breadth first order JF> and gets the newest version of zope.testing before it tries to get the JF> restricted dependency of zc.recipe.testrunner.
JF> The easiest way to fix this is to remove the redundant and now JF> incorrect reference to zope.testing in the call to JF> self.egg.working_set:
JF> eggs, ws = self.egg.working_set()
Thanks for the pointer, but in my case it seems to work only with the version spec added:
eggs, ws = self.egg.working_set(('zope.testing <3.10.0', ))
If I do
eggs, ws = self.egg.working_set()
zope.testing seems to be missed from the test script entirely.
Ah, that makes sense when you're testing something other than zc.recipe.testrunner itself.
Jim
participants (3)
-
Adam GROSZER
-
Jim Fulton
-
P.J. Eby