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.
With any requirements.in file
pip-compileSuccess
See traceback above.
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.
Most helpful comment
Will be released in the next hours unless something terrible happens.