Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
pip wheel does not cache wheels it built locally #6852
pip wheel does not cache wheels it built locally, whereas pip install does.
My use case for
pip wheel should cache all wheels it built locally (i.e. built from sdists on pypi),
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.
$ venv/bin/pip wheel pyyaml==5.1.2 Collecting pyyaml==5.1.2 Using cached https://files.pythonhosted.org/packages/e3/e8/b3212641ee2718d556df0f23f78de8303f068fe29cdaa7a91018849582fe/PyYAML-5.1.2.tar.gz Building wheels for collected packages: pyyaml Building wheel for pyyaml (setup.py) ... done Created wheel for pyyaml: filename=PyYAML-5.1.2-cp37-cp37m-linux_x86_64.whl size=44104 sha256=0c0a590c4188291ddce3d984cab5d4868115181183a3972fdf95560cc9530f93 Stored in directory: /tmp/brol1 Successfully built pyyaml
Next, pip install the same, and notice pip builds and caches the wheel.
$ venv/bin/pip install pyyaml==5.1.2 ... Building wheel for pyyaml (setup.py) ... done Created wheel for pyyaml: filename=PyYAML-5.1.2-cp37-cp37m-linux_x86_64.whl size=44104 sha256=a8625826f5bdcb1434d9d8339542db1d47d3f84bf27c2180c39345f34d98821c Stored in directory: ~/.cache/pip/wheels/d9/45/dd/65f0b38450c47cf7e5312883deb97d065e030c5cca0a365030 ...
Finally pip wheel again and notice it uses the cached wheel.
$ rm PyYAML-5.1.2* $ venv/bin/pip wheel pyyaml==5.1.2 Collecting pyyaml==5.1.2 Saved ./PyYAML-5.1.2-cp37-cp37m-linux_x86_64.whl Skipping pyyaml, due to already being wheel.
I noticed this issue while working on #6640.
I think the problem arises in this area.
A solution could be to always build to the cache directory, and in case we are not autobuilding copy