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

pex does not resolve the same version as pip for llvmlite 0.29.0 #761

Closed
tibonihoo opened this issue Aug 21, 2019 · 1 comment · Fixed by #788
Closed

pex does not resolve the same version as pip for llvmlite 0.29.0 #761

tibonihoo opened this issue Aug 21, 2019 · 1 comment · Fixed by #788
Assignees

Comments

@tibonihoo
Copy link

When trying to use the documented pattern of collecting wheels with pip and then using the wheelhouse with --no-index for pex generation of a project, I came across a blocking issue due to a difference in which pex and pip resolved the package name for the 0.29.0 version of llvmlite.

Please find below the sequence of commands that "minimally" reproduce the issue (along with showing the versions of the various tools involved):

~/shared/Development $mkdir pex-repro
~/shared/Development $cd pex-repro/
~/shared/Development/pex-repro $python3.6 -m venv venv-linux
~/shared/Development/pex-repro $source venv-linux/bin/activate
(venv-linux) ~/shared/Development/pex-repro $python -m pip install --upgrade pip
(...)
Successfully installed pip-19.2.2
(venv-linux) ~/shared/Development/pex-repro $python -m pip install --upgrade pex
(...)
Successfully installed pex-1.6.10
(venv-linux) ~/shared/Development/pex-repro $python -m pip freeze
pex==1.6.10
(venv-linux) ~/shared/Development/pex-repro $python -m pip wheel -w wheelhouseDir "llvmlite>=0.29.0,<0.30.0"
(...)
  Saved ./wheelhouseDir/llvmlite-0.29.0-1-cp36-cp36m-manylinux1_x86_64.whl
Skipping llvmlite, due to already being wheel.
(venv-linux) ~/shared/Development/pex-repro $python -m pex -f wheelhouseDir --no-index --disable-cache "llvmlite>=0.29.0,<0.30.0" -o test.pex
Could not satisfy all requirements for llvmlite<0.30.0,>=0.29.0:
    llvmlite<0.30.0,>=0.29.0

For reference and comparison, using pex directly with the same requirement and allowing it to resolve the reference from the package index directly works:

(venv-linux) ~/shared/Development/pex-repro $python -m pex -f wheelhouseDir -i https://pypi.org/simple/ -vv --disable-cache "llvmlite>=0.29.0,<0.30.0
" -o test.pex
pex: Warning, using a UrllibContext which is known to be flaky.
pex: Please build pex with the requests module for more reliable downloads.
pex: Building pex :: Resolving distributions :: Fetching https://files.pythonhosted.org/packages/09/f1/4fa99c2079132da8694361fb9a19094616f1ba2c2eae610379e7539pex: Building pex :: Resolving distributions :: Fetching https://files.pythonhosted.org/packages/09/f1/4fa99c2079132da8694361fb9a19094616f1ba2c2eae610379e75394575f/llvmlite-0.29.0-cp36-cp36m-manylinux1_x86_64.whl#sha256=bd68e01f1444e38983a364ad1810bdaf3eb59ca1fe8aff4a33cc17a90cb9fcdb :: Fetching https://files.pythonhosted.org/packages/09/f1/4fa99c2079132da8694361fb9a19094616f1ba2c2eae610379e75394575f/llvmlite-0.29.0-cp36-cp36m-manylinux1_x86_64.whl#sha256=bd68e01f1444e3pex: Building pex :: Resolving distributions :: Translating /tmp/tmp6utook28/llvmlite-0.29.0-cp36-cp36m-manylinux1_x86_64.whl into distribution                                                                                                                                                                                                                                                                                                                                             llvmlite<0.30.0,>=0.29.0 -> llvmlite 0.29.0
pex: Building pex: 9075.3ms
pex:   Resolving interpreters: 5.7ms
pex:   Resolving distributions: 9065.0ms
pex:     Fetching https://files.pythonhosted.org/packages/09/f1/4fa99c2079132da8694361fb9a19094616f1ba2c2eae610379e75394575f/llvmlite-0.29.0-cp36-cp36m-manylinux1_x86_64.whl#sha256=bd68e01f1444e38983a364ad1810bdaf3eb59ca1fe8aff4a33cc17a90cb9fcdb: 5689.0ms
pex:       Fetching https://files.pythonhosted.org/packages/09/f1/4fa99c2079132da8694361fb9a19094616f1ba2c2eae610379e75394575f/llvmlite-0.29.0-cp36-cp36m-manylinux1_x86_64.whl#sha256=bd68e01f1444e38983a364ad1810bdaf3eb59ca1fe8aff4a33cc17a90cb9fcdb: 5688.5ms
pex:     Translating /tmp/tmp6utook28/llvmlite-0.29.0-cp36-cp36m-manylinux1_x86_64.whl into distribution: 2.6ms
Saving PEX file to test.pex

As a summary of what happened:

  • pip resolved: llvmlite-0.29.0-1-cp36-cp36m-manylinux1_x86_64.whl
  • pex resolved: llvmlite-0.29.0-cp36-cp36m-manylinux1_x86_64.whl

So it seems the extra -1 in the august release of llvmlite for version 0.29.0 triggered the discrepancy.

I can understand that the llvmlite naming is possibly breaking some typical assumption on package name and versionning, but the discrepancy between pex and pip is what is really bothering me here as it breaks the "build wheelhouse -> build pex from wheelhouse" workflow.

Am I missing an option that would help having a version resolution that better matches pip ?

As last notes of context about my real use case (for the sake of completeness):

  • llvmlite is a dependency of an external dependency and I don't have much ways to impose any restriction on its exact version.
  • I do need to constraint the set of wheels pex will use (so the "pex from wheelhouse" features makes a lot of sense for me)
@tibonihoo
Copy link
Author

My current workaround to this issue is to use pex --cache-dir ... to force pex to collect my external dependencies' wheels (thus replacing pip wheel -w ...) in the provided cache directory and to then provide this cache directory as an extra wheelhouse to another call to pex.

Obviously this way of relying on a tool's caching strategy is a fairly bad practice, so I'm also wondering if there are more reliable ways to deal with this issue with the current version of the tool.

@jsirois jsirois self-assigned this Nov 14, 2019
jsirois added a commit that referenced this issue Nov 14, 2019
This changes Pex to vendor pip and defer all resolution and building to it.

As part of this change some ambiguous and / or broken features were changed and APIs adjusted:
+ The egg distribution format is no longer supported.
+ The deprecated `--interpreter-cache-dir` CLI option was removed.
+ The `--cache-ttl` CLI option and `cache_ttl` resolver API argument were removed.
+ The resolver API replaced `fetchers` with a list of `indexes` and a list of `find_links` repos.
+ The resolver API removed (http) `context` which is now automatically handled.
+ The resolver API removed `precedence` which is now pip default precedence - wheels when available and not ruled out via the `--no-wheel` CLI option or `use_wheel=False` API argument.
+ The `--platform` CLI option and `platform` resolver API argument now must be full platform strings that include platform, implementation, version and abi; e.g.: `--platform=macosx-10.13-x86_64-cp-36-m`.
+ The `--manylinux` CLI option and `use_manylinux` resolver API argument were removed. Instead, to resolve manylinux wheels for a foreign platform, specify the manylinux platform to use with an explicit `--platform` CLI flag or `platform` resolver API argument; e.g.: `--platform=manylinux2010-x86_64-cp-36-m`.

Fixes #781

Additionally:
Fixes #771
Fixes #763
Fixes #761
Fixes #735 
Fixes #694 
Fixes #660
Fixes #658 
Fixes #642
Fixes #641
Fixes #628
Fixes #620
Fixes #614
Fixes #611
Fixes #608
Fixes #439
Fixes #415
Fixes #387
Fixes #315
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants