Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip-tools 3.0.0 incompatible with pip 18.1 #688

Closed
vphilippon opened this issue Oct 5, 2018 · 4 comments
Closed

pip-tools 3.0.0 incompatible with pip 18.1 #688

vphilippon opened this issue Oct 5, 2018 · 4 comments

Comments

@vphilippon
Copy link
Member

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.

@vphilippon vphilippon added PR wanted Feature is discussed or bug is confirmed, PR needed help wanted Request help from the community labels Oct 5, 2018
@eseifert
Copy link

eseifert commented Oct 5, 2018

I guess this is related to commit pypa/pip@a5a07fe, which moved pip._internal.req.req_install.InstallRequirement.from_line to pip._internal.req.constructors.install_req_from_line.

@vphilippon
Copy link
Member Author

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

@eseifert
Copy link

eseifert commented Oct 5, 2018

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 pypa/pip@69b494a).

@vphilippon vphilippon mentioned this issue Oct 5, 2018
3 tasks
vphilippon added a commit to vphilippon/pip-tools that referenced this issue Oct 5, 2018
Added shims for the move of `InstallRequirement.from_line` and
`InstallRequirement.from_editable` to
`constructors.install_req_from_line` and
`constructors.install_req_from_editable`.

Fixes jazzband#688
@vphilippon vphilippon removed the help wanted Request help from the community label Oct 5, 2018
@vphilippon
Copy link
Member Author

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

@vphilippon vphilippon removed the PR wanted Feature is discussed or bug is confirmed, PR needed label Oct 5, 2018
fdemmer added a commit to fdemmer/ansible_roles that referenced this issue Oct 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants