Version constraints break allow-picked-versions = false #236

Open
cjwatson opened this Issue Jan 21, 2015 · 1 comment

Comments

Projects
None yet
2 participants

The addition of simple version constraints in zc.buildout 2.0.0 appears to have broken allow-picked-versions = false in some cases. Here's a reduced example with zc.buildout 2.3.0 (disclaimer: I haven't actually tested back to 2.0.0):

$ cat buildout.cfg
[buildout]
parts = docs
develop = .
download-cache = download-cache
eggs-directory = eggs
install-from-cache = false
allow-picked-versions = true
use-dependency-links = false

[docs]
recipe = z3c.recipe.sphinxdoc
eggs = buildout-bug [docs]

[versions]
docutils = 0.12
Jinja2 = 2.6
Pygments = 2.0.2
setuptools = 12.0.4
Sphinx = 1.1.3
z3c.recipe.sphinxdoc = 1.0.0
zc.buildout = 2.3.0
zc.recipe.egg = 2.0.1

$ cat setup.py
from setuptools import setup

setup(
    name='buildout-bug',
    extras_require=dict(
        docs=['Sphinx',
              'z3c.recipe.sphinxdoc']))

To initialise the test package (I did this inside virtualenv --no-setuptools --no-pip), run:

mkdir -p download-cache eggs
python bootstrap.py
bin/buildout

Now change buildout.cfg to have install-from-cache = true and allow-picked-versions = false, and try buildout again:

$ bin/buildout -v
Installing 'zc.buildout', 'setuptools'.
We have the distribution that satisfies 'zc.buildout==2.3.0'.
We have the distribution that satisfies 'setuptools==12.0.4'.
Develop: '/home/cjwatson/tmp/buildout-bug/.'
Installing 'z3c.recipe.sphinxdoc'.
We have the distribution that satisfies 'z3c.recipe.sphinxdoc==1.0.0'.
Getting required 'Sphinx==1.1.3'
We have the distribution that satisfies 'Sphinx==1.1.3'.
Getting required 'docutils==0.12'
We have the distribution that satisfies 'docutils==0.12'.
Getting required 'zc.recipe.egg==2.0.1'
We have the distribution that satisfies 'zc.recipe.egg==2.0.1'.
Getting required 'Jinja2==2.6,>=2.3'
Not found: /home/cjwatson/tmp/buildout-bug/download-cache/dist/Jinja2/
Not found: /home/cjwatson/tmp/buildout-bug/download-cache/dist/Jinja2/
We have the best distribution that satisfies 'Jinja2==2.6,>=2.3'.
Picked: Jinja2 = 2.6
While:
  Installing.
  Getting section docs.
  Initializing section docs.
  Installing recipe z3c.recipe.sphinxdoc.
  Getting distribution for 'Jinja2==2.6,>=2.3'.
Error: Picked: Jinja2 = 2.6

The ==2.6 constraint comes from buildout.cfg, but the >=2.3 constraint comes from Sphinx 1.1.3. It seems to me that zc.buildout should notice that version 2.6 was defined in the buildout configuration and not make this an error just because it had to check it against an additional constraint.

Contributor

mauritsvanrees commented Aug 6, 2015

I just checked this and can confirm it with the versions you give.

But when I update the zc.buildout version to 2.3.1 it works. You need to switch install-from-cache to false once so you can get the new buildout version, and after that you can switch to true again and buildout will run just fine. From the CHANGES.rst it looks like this is exactly the problem that was fixed in that buildout version.

Can you confirm it works with 2.3.1 or later?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment