Skip to content

dynamic install_requires breaks universal wheels #36

@mgedmin

Description

@mgedmin

pip 7 builds and caches wheels, which speeds up repeated installs.

Unfortunately, if you build a wheel of ZODB on Python 2.6, it will compute install_requires that works on 2.6 but fails on 2.7 (because no 'zodbpickle'). This wheel will be named ZODB-4.2.0b1-py2-none-any.whl, and so pip will try to use it on 2.7. This breaks people's buildbots.

STEPS TO REPRODUCE:

$ virtualenv --version
13.0.1

$ cat tox.ini
[tox]
envlist = py26,py27
skipsdist = true

[testenv]
skip_install = true
deps = ZODB
commands =
  python -c 'import ZODB'

$ rm ~/.cache/pip/wheels/*/*/*/*/ZODB-*.whl

$ tox --pre
py26 installed: argparse==1.3.0,BTrees==4.1.3,persistent==4.1.0,six==1.9.0,transaction==1.4.4,wheel==0.24.0,zc.lockfile==1.1.0,ZConfig==3.0.4,zdaemon==4.1.0,ZODB==4.2.0b1,zope.interface==4.1.2
py26 runtests: PYTHONHASHSEED='2859500558'
py26 runtests: commands[0] | python -c import ZODB
py27 recreate: /tmp/bork/.tox/py27
py27 installdeps: ZODB
py27 installed: BTrees==4.1.3,persistent==4.1.0,six==1.9.0,transaction==1.4.4,wheel==0.24.0,zc.lockfile==1.1.0,ZConfig==3.0.4,zdaemon==4.1.0,ZODB==4.2.0b1,zope.interface==4.1.2
py27 runtests: PYTHONHASHSEED='2859500558'
py27 runtests: commands[0] | python -c import ZODB
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/bork/.tox/py27/local/lib/python2.7/site-packages/ZODB/__init__.py", line 28, in <module>
    from ZODB.DB import DB, connection
  File "/tmp/bork/.tox/py27/local/lib/python2.7/site-packages/ZODB/DB.py", line 23, in <module>
    from ZODB.broken import find_global
  File "/tmp/bork/.tox/py27/local/lib/python2.7/site-packages/ZODB/broken.py", line 23, in <module>
    from ZODB._compat import IMPORT_MAPPING
  File "/tmp/bork/.tox/py27/local/lib/python2.7/site-packages/ZODB/_compat.py", line 42, in <module>
    import zodbpickle.pickle
ImportError: No module named zodbpickle.pickle
ERROR: InvocationError: '/tmp/bork/.tox/py27/bin/python -c import ZODB'
___________________________________ summary ___________________________________
  py26: commands succeeded
ERROR:   py27: commands failed

$ ls ~/.cache/pip/wheels/*/*/*/*/ZODB*
/home/mg/.cache/pip/wheels/98/e4/85/1b42bbea2eb9f3d1bd2043843104a15121cdeceaa24ad659d1/ZODB-4.2.0b1-py2-none-any.whl

I can see three possible solutions:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions