pip-tools 3.0.0 incompatible with pip 18.1

Created on 5 Oct 2018  路  4Comments  路  Source: jazzband/pip-tools

pip 18.1 did some internal changes that break pip-tools.

Traceback example:

Traceback (most recent call last):
  File "/usr/local/bin/pip-compile", line 11, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/piptools/scripts/compile.py", line 191, in cli
    results = resolver.resolve(max_rounds=max_rounds)
  File "/usr/local/lib/python2.7/site-packages/piptools/resolver.py", line 101, in resolve
    has_changed, best_matches = self._resolve_one_round()
  File "/usr/local/lib/python2.7/site-packages/piptools/resolver.py", line 190, in _resolve_one_round
    best_matches = {self.get_best_match(ireq) for ireq in constraints}
  File "/usr/local/lib/python2.7/site-packages/piptools/resolver.py", line 190, in <setcomp>
    best_matches = {self.get_best_match(ireq) for ireq in constraints}
  File "/usr/local/lib/python2.7/site-packages/piptools/resolver.py", line 255, in get_best_match
    best_match = self.repository.find_best_match(ireq, prereleases=self.prereleases)
  File "/usr/local/lib/python2.7/site-packages/piptools/repositories/pypi.py", line 129, in find_best_match
    best_candidate.project, best_candidate.version, ireq.extras, constraint=ireq.constraint
  File "/usr/local/lib/python2.7/site-packages/piptools/utils.py", line 51, in make_install_requirement
    return InstallRequirement.from_line(
AttributeError: type object 'InstallRequirement' has no attribute 'from_line'

Seems like InstallRequirement.from_line is gone. We'll have to check if there's an equivalent that can be used.

Environment Versions
  1. OS Type: Any (test done on Linux)
  2. Python version: Any (test done on 2.7.x)
  3. pip version: 18.1
  4. pip-tools version: 3.0.0
Steps to replicate

With any requirements.in file

  1. pip-compile
Expected result

Success

Actual result

See traceback above.

Most helpful comment

Will be released in the next hours unless something terrible happens.

All 4 comments

I guess this is related to commit https://github.com/pypa/pip/commit/a5a07fe61c4861c58fded7420c929d56cde11a89, which moved pip._internal.req.req_install.InstallRequirement.from_line to pip._internal.req.constructors.install_req_from_line.

Thanks @eseifert, that helped, We might be able to fix this today.

No problem. That's great news!

pip._internal.req.req_install.InstallRequirement.from_editable was also moved to pip._internal.req.constructors.install_req_from_editable by the way (see https://github.com/pypa/pip/commit/69b494aa29096838addad0735359f9406d74252a).

Will be released in the next hours unless something terrible happens.

Was this page helpful?
0 / 5 - 0 ratings