[Python-modules-team] Bug#814397: python-pip: breaks pip-tools

Alexander Clausen alex at gc-web.de
Thu Feb 11 08:17:22 UTC 2016


Package: python-pip
Version: 8.0.2-5
Severity: normal

Dear Maintainer,

After upgrading python-pip, pip-compile from the pypi package pip-tools
doesn't work anymore (installed in a virtualenv):

$ cd /tmp
$ virtualenv test
[...]
$ cd test
$ . bin/activate
$ pip install pip-tools
[...]
$ echo 'django' > req.in
$ pip-compile req.in
Traceback (most recent call last):
  File "/tmp/test/bin/pip-compile", line 11, in <module>
    sys.exit(cli())
  File "/tmp/test/local/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/tmp/test/local/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/tmp/test/local/lib/python2.7/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/tmp/test/local/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/tmp/test/local/lib/python2.7/site-packages/piptools/scripts/compile.py", line 163, in cli
    results = resolver.resolve()
  File "/tmp/test/local/lib/python2.7/site-packages/piptools/resolver.py", line 78, in resolve
    has_changed, best_matches = self._resolve_one_round()
  File "/tmp/test/local/lib/python2.7/site-packages/piptools/resolver.py", line 154, in _resolve_one_round
    best_matches = set(self.get_best_match(ireq) for ireq in constraints)
  File "/tmp/test/local/lib/python2.7/site-packages/piptools/resolver.py", line 154, in <genexpr>
    best_matches = set(self.get_best_match(ireq) for ireq in constraints)
  File "/tmp/test/local/lib/python2.7/site-packages/piptools/resolver.py", line 201, in get_best_match
    best_match = self.repository.find_best_match(ireq, prereleases=self.prereleases)
  File "/tmp/test/local/lib/python2.7/site-packages/piptools/repositories/pypi.py", line 103, in find_best_match
    prereleases=prereleases)
  File "/tmp/test/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/_vendor/packaging/specifiers.py", line 763, in filter
  File "/tmp/test/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/_vendor/packaging/version.py", line 41, in parse
  File "/tmp/test/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/_vendor/packaging/version.py", line 210, in __init__
TypeError: expected string or buffer

I tracked the problem down to the following:

> /tmp/test/local/lib/python2.7/site-packages/pkg_resources/_vendor/packaging/specifiers.py(763)filter()
    761                 # Ensure that we some kind of Version class for this item.
    762                 if not isinstance(item, (LegacyVersion, Version)):
--> 763                     parsed_version = parse(item)
    764                 else:
    765                     parsed_version = item

ipdb> p item.__class__
<class 'pip._vendor.packaging.version.Version'>
ipdb> p Version
<class 'pkg_resources._vendor.packaging.version.Version'>
ipdb> 

I suspect this has something to do with the debundle process?
If I understand it correctly, when debuldeling is in effect,
pip._vendor.pkg_resources should not be used, in favour of
pkg_resources?

Replacing pip with a version from pypi fixes the problem:

$ pip install -U pip --force-reinstall
[...]
$ pip --version
pip 8.0.2 from /tmp/test/local/lib/python2.7/site-packages (python 2.7)
$ pip-compile req.in
[...]
django==1.9.2

Thanks,
Alexander



-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.3.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages python-pip depends on:
ii  ca-certificates  20160104
ii  python-pip-whl   8.0.2-5
pn  python:any       <none>

Versions of packages python-pip recommends:
ii  build-essential  12.2
ii  python-all-dev   2.7.11-1
ii  python-wheel     0.26.0-1

python-pip suggests no packages.

-- no debconf information



More information about the Python-modules-team mailing list