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

New resolver cannot installs distributions that only have pre releases #8075

Closed
sbidoul opened this issue Apr 18, 2020 · 3 comments · Fixed by #8079
Closed

New resolver cannot installs distributions that only have pre releases #8075

sbidoul opened this issue Apr 18, 2020 · 3 comments · Fixed by #8079
Labels
auto-locked Outdated issues that have been locked by automation type: bug A confirmed bug or unintended behavior

Comments

@sbidoul
Copy link
Member

sbidoul commented Apr 18, 2020

Environment

  • pip version: master, today
  • Python version: 3
  • OS: linux

Description

I want to install a distribution that only has pre-releases. The legacy resolver does support this. The new one does not.

Note: using --pre does not seem to influence the result. The legacy resolver could install such distributions without using --pre.

Expected behavior

Installation should succeed.

How to Reproduce

$ pip install --no-deps odoo13-addon-date-range --unstable-feature=resolver
ERROR: Exception:
Traceback (most recent call last):
  File "/home/me/pip/src/pip/_internal/cli/base_command.py", line 199, in _main
    status = self.run(options, args)
  File "/home/me/pip/src/pip/_internal/cli/req_command.py", line 185, in wrapper
    return func(self, options, args)
  File "/home/me/pip/src/pip/_internal/commands/install.py", line 333, in run
    reqs, check_supported_wheels=not options.target_dir
  File "/home/me/pip/src/pip/_internal/resolution/resolvelib/resolver.py", line 80, in resolve
    self._result = resolver.resolve(requirements)
  File "/home/me/pip/src/pip/_vendor/resolvelib/resolvers.py", line 413, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
  File "/home/me/pip/src/pip/_vendor/resolvelib/resolvers.py", line 310, in resolve
    failure_causes = self._attempt_to_pin_criterion(name, criterion)
  File "/home/me/pip/src/pip/_vendor/resolvelib/resolvers.py", line 240, in _attempt_to_pin_criterion
    raise InconsistentCandidate(candidate, criterion)
pip._vendor.resolvelib.resolvers.InconsistentCandidate: Provided candidate LinkCandidate('https://files.pythonhosted.org/packages/1f/0b/945335a37082b6b013cc1331f49e3f5b6a18cdd0b693475e6ca9e9a7df6e/odoo13_addon_date_range-13.0.1.0.1.dev8-py3-none-any.whl#sha256=3883bbe87db8d5db4364e8a42e86546e19e8e4f123d98c4e9454587dfa9401df (from https://pypi.org/simple/odoo13-addon-date-range/) (requires-python:>=3.5)') does not satisfy SpecifierRequirement('odoo13-addon-date-range')

Note I used --no-deps because a dependency is not on pypi, but that has no influence on the result.

@sbidoul sbidoul added type: bug A confirmed bug or unintended behavior C: new resolver labels Apr 18, 2020
@uranusjr
Copy link
Member

InconsistentCandidate is raised if a match from find_matches() does not return true for is_satisfied_by(). So my guess is we need to fix is_satisfied_by() to accept prereleases.

@pradyunsg
Copy link
Member

Nice catch @sbidoul! ^>^

I don't think this needs to be fixed right now prior to pip 20.1's beta, but yes, we do have to implement this eventually. :)

@pradyunsg pradyunsg added this to To do in New Resolver Implementation via automation Apr 18, 2020
@uranusjr
Copy link
Member

It would also fail with --pre if the selected version is a prerelease. Not all prereleases fail though, only if the specifier does not contain a prerelease. I think I have a fix.

@uranusjr uranusjr moved this from To do to In progress in New Resolver Implementation Apr 18, 2020
New Resolver Implementation automation moved this from In progress to Done Apr 19, 2020
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label May 20, 2020
@lock lock bot locked as resolved and limited conversation to collaborators May 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation type: bug A confirmed bug or unintended behavior
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

3 participants