pip resolver searches for target itself and fails

Created on 21 May 2020  路  7Comments  路  Source: pypa/pip

I did not manage to create a small reproducible of this in isolation, however, something is definitely off. Creating a tox test suite fails for virtualenv project:

git clone https://github.com/pypa/virtualenv
env PIP_UNSTABLE_FEATURE="resolver" VIRTUALENV_PIP=20.2b1 tox -re py38 --notest

throws:

env PIP_UNSTABLE_FEATURE="resolver" VIRTUALENV_PIP=20.2b1 tox -re py38 --notest                                                                                                                      .package recreate: /Users/bernat/git/github/virtualenv/.tox/.package
.package installdeps: setuptools >= 41.0.0, wheel >= 0.30.0, setuptools_scm >= 2
py38 recreate: /Users/bernat/git/github/virtualenv/.tox/py38
py38 installdeps: pip >= 20.0.2
py38 inst: /Users/bernat/git/github/virtualenv/.tox/.tmp/package/1/virtualenv-20.0.21.dev10+gc364311.tar.gz
ERROR: invocation failed (exit code 1), logfile: /Users/bernat/git/github/virtualenv/.tox/py38/log/py38-2.log
================================================================================================================================== log start ===================================================================================================================================
Looking in indexes: http://localhost:3141/bernat/bb
Processing ./.tox/.tmp/package/1/virtualenv-20.0.21.dev10+gc364311.tar.gz
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
    Preparing wheel metadata: started
    Preparing wheel metadata: finished with status 'done'
ERROR: Could not find a version that satisfies the requirement virtualenv==20.0.21.dev10+gc364311 (from virtualenv[testing])
ERROR: No matching distribution found for virtualenv

When switching to verbose mode I can see:

Given no hashes to check 0 links for project 'virtualenv': discarding no candidates
ERROR: Could not find a version that satisfies the requirement virtualenv==20.0.21.dev10+gc364311 (from virtualenv[testing])
ERROR: No matching distribution found for virtualenv
Exception information:
Traceback (most recent call last):
  File "/Users/bernat/git/github/virtualenv/.tox/py38/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 136, in resolve
    self._result = resolver.resolve(
  File "/Users/bernat/git/github/virtualenv/.tox/py38/lib/python3.8/site-packages/pip/_vendor/resolvelib/resolvers.py", line 413, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
  File "/Users/bernat/git/github/virtualenv/.tox/py38/lib/python3.8/site-packages/pip/_vendor/resolvelib/resolvers.py", line 319, in resolve
    raise ResolutionImpossible(causes)
pip._vendor.resolvelib.resolvers.ResolutionImpossible: [RequirementInformation(requirement=SpecifierRequirement('virtualenv==20.0.21.dev10+gc364311'), parent=ExtrasCandidate(base=LinkCandidate('file:///Users/bernat/git/github/virtualenv/.tox/.tmp/package/1/virtualenv-20.0.21.dev10%2Bgc364311.tar.gz'), extras={'testing'}))]
new resolver auto-locked bug

Most helpful comment

When was the last time I said I hate extras?

More than two weeks ago, so definitely allowed again in my case.

All 7 comments

Sounds similar to this section of failures:

https://hackmd.io/TkGB1hPQTcu9y_4JwAtGyA?view#Direct-URL-with-extras

Not sure if we already have a tracking issue for this, so I鈥檓 labelling this as a normal bug report.

This is definitely a case of non-specifier requirement that has extras (similar to .[dev]). I'd argue this isn't a bug as much as it is a TODO for the new resolver. :P

We even have a FIXME comment in the code for it. (Which I'm looking at now. When was the last time I said I hate extras? 馃檪)

I just call all found errors a feature gap compared to the current no dependency resolver 馃榿 bug or feature, that's detail under the hood. 馃槑

(Which I'm looking at now. When was the last time I said I hate extras? 馃檪)

More than a day ago, so you can say that again. :)

When was the last time I said I hate extras?

More than two weeks ago, so definitely allowed again in my case.

FWIW, I think have a bugfix branch for this locally, so I'll be filing that sometime next week. (once my college's last report submission is done with)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dstufft picture dstufft  路  3Comments

dmfigol picture dmfigol  路  3Comments

cjolowicz picture cjolowicz  路  3Comments

jiapei100 picture jiapei100  路  3Comments

therefromhere picture therefromhere  路  3Comments