Pip-tools: pip-compile broken with pip 19.1

Created on 24 Apr 2019  路  6Comments  路  Source: jazzband/pip-tools

Describe the issue briefly here.

Environment Versions
  1. OS Type
    linux KDE Neon
  2. Python version: $ python -V
    Python 3.7.3
  3. pip version: $ pip --version
    pip 19.1 from /home/User/.pyenv/versions/3.7.3/envs/test/lib/python3.7/site-packages/pip (python 3.7)
  4. pip-tools version: $ pip-compile --version
    pip-compile, version 3.6.0

    Steps to replicate
  5. upgrade pip to latest version:

$ pip install -U pip
Collecting pip
  Using cached https://files.pythonhosted.org/packages/f9/fb/863012b13912709c13cf5cfdbfb304fa6c727659d6290438e1a88df9d848/pip-19.1-py2.py3-none-any.whl
Installing collected packages: pip
  Found existing installation: pip 19.0.3
    Uninstalling pip-19.0.3:
      Successfully uninstalled pip-19.0.3
Successfully installed pip-19.1
  1. run pip-compile:
$ pip-compile -U
Traceback (most recent call last):
  File "/home/User/.pyenv/versions/3.7.3/envs/test/bin/pip-compile", line 10, in <module>
    sys.exit(cli())
  File "/home/User/.pyenv/versions/3.7.3/envs/test/lib/python3.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/User/.pyenv/versions/3.7.3/envs/test/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/User/.pyenv/versions/3.7.3/envs/test/lib/python3.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/User/.pyenv/versions/3.7.3/envs/test/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/User/.pyenv/versions/3.7.3/envs/test/lib/python3.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/User/.pyenv/versions/3.7.3/envs/test/lib/python3.7/site-packages/piptools/scripts/compile.py", line 352, in cli
    results = resolver.resolve(max_rounds=max_rounds)
  File "/home/User/.pyenv/versions/3.7.3/envs/test/lib/python3.7/site-packages/piptools/resolver.py", line 119, in resolve
    has_changed, best_matches = self._resolve_one_round()
  File "/home/User/.pyenv/versions/3.7.3/envs/test/lib/python3.7/site-packages/piptools/resolver.py", line 217, in _resolve_one_round
    best_matches = {self.get_best_match(ireq) for ireq in constraints}
  File "/home/User/.pyenv/versions/3.7.3/envs/test/lib/python3.7/site-packages/piptools/resolver.py", line 217, in <setcomp>
    best_matches = {self.get_best_match(ireq) for ireq in constraints}
  File "/home/User/.pyenv/versions/3.7.3/envs/test/lib/python3.7/site-packages/piptools/resolver.py", line 291, in get_best_match
    ireq, prereleases=self.prereleases
  File "/home/User/.pyenv/versions/3.7.3/envs/test/lib/python3.7/site-packages/piptools/repositories/pypi.py", line 147, in find_best_match
    best_candidate = max(matching_candidates, key=self.finder._candidate_sort_key)
AttributeError: 'PackageFinder' object has no attribute '_candidate_sort_key'
bug pip

Most helpful comment

pip-tools v3.6.1 is released.

All 6 comments

Hello @tonal,

Thanks for the report! Could you please paste here your requirements.in and requirements.txt?

UPDATE: no need, seems it doesn't work at all.

requirements.in:

# -*- coding: utf-8 -*-

aiodns
aiohttp
aiomysql
cchardet
uvloop

aiostream

envparse
pyyaml

python-logstash
sentry-sdk

lxml

fastnumbers

requirements.txt:

#
# This file is autogenerated by pip-compile
# To update, run:
#
#    pip-compile -U
#
aiodns==2.0.0
aiohttp==3.5.4
aiomysql==0.0.20
aiostream==0.3.1
asn1crypto==0.24.0        # via cryptography
async-timeout==3.0.1      # via aiohttp
attrs==19.1.0             # via aiohttp
cchardet==2.1.4
certifi==2019.3.9         # via sentry-sdk
cffi==1.12.3              # via cryptography, pycares
chardet==3.0.4            # via aiohttp
cryptography==2.6.1       # via pymysql
envparse==0.2.0
fastnumbers==2.2.1
idna==2.8                 # via yarl
lxml==4.3.3
multidict==4.5.2          # via aiohttp, yarl
pycares==3.0.0            # via aiodns
pycparser==2.19           # via cffi
pymysql==0.9.2            # via aiomysql
python-logstash==0.4.6
pyyaml==5.1
sentry-sdk==0.7.11
six==1.12.0               # via cryptography
urllib3==1.25             # via sentry-sdk
uvloop==0.12.2
yarl==1.3.0               # via aiohttp

If downgrade pip to 19.0.3 all work.

There are breaking changes from https://github.com/pypa/pip/pull/6424. Okay, let's make a compatible version.

Do you plan to release this fix in near future?

Hello @pkierski. As soon as possible.

pip-tools v3.6.1 is released.

Was this page helpful?
0 / 5 - 0 ratings