Pip: New resolver cannot installs distributions that only have pre releases

Created on 18 Apr 2020  ·  3Comments  ·  Source: pypa/pip

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.

new resolver auto-locked bug

All 3 comments

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.

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. :)

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.

Was this page helpful?
0 / 5 - 0 ratings