pip wheel does not cache wheels it built locally #6852
Labels
auto-locked
Outdated issues that have been locked by automation
C: wheel
The wheel format and 'pip wheel' command
type: enhancement
Improvements to functionality
Environment
Description
pip wheel does not cache wheels it built locally, whereas pip install does.
My use case for
pip wheel
is mostlypip wheel -r frozen-requirements.txt
to buildand collect everything needed for testing on CI and deployment. For wheels that have a long build time it would help to have them cached too in such a scenario.
Expected behavior
pip wheel should cache all wheels it built locally (i.e. built from sdists on pypi),
like pip install does.
How to Reproduce
Here is an example with pyyaml 5.1.2 wich, as of today, has no linux wheel on PyPI.
First make sure the pip cache is empty.
Use pip wheel, notice it uses the (possibly cached) sdist, and builds the wheel.
Repeat and notice the behaviour remains the same.
Next, pip install the same, and notice pip builds and caches the wheel.
Finally pip wheel again and notice it uses the cached wheel.
Analysis
I noticed this issue while working on #6640.
I think the problem arises in this area.
The output directory provided to
_build_one
is either the cache (whenautobuilding
), or the target directory provided by the user in case ofpip wheel
, in which case the cache is bypassed.A solution could be to always build to the cache directory, and in case we are not autobuilding copy
wheel_file
toself._wheel_dir
after building.The text was updated successfully, but these errors were encountered: