[Distutils] Pip different installation behavior when using --no-cache-dir

Laurent Mazuel lmazuel at microsoft.com
Fri Mar 24 12:49:05 EDT 2017


Hello,

I was talking with Brett Cannon at work today about why “python setup.py install” is called when `--no-cache-dir` is specified instead of python setup.py bdist_wheel in the normal case. He didn't know the answer and suggested I ask here to see if it's on purpose or just an oversight of when caching was introduced.

Basically we have a situation where we tweak a little the bdist_wheel step in our setup.py to take advantage of the “flat” install of pip, and allow easyinstall to work perfectly from the sdist at the same time. Pip install of the sdist file works like a charm, since as expected pip call bdist_wheel first (and apply our changes):
> pip install .\azure-common-1.1.4.zip
Processing d:\vsprojects\azure-sdk-for-python-official\wheelhouse\azure-common-1.1.4.zip
Building wheels for collected packages: azure-common
  Running setup.py bdist_wheel for azure-common ... done
  Stored in directory: C:\Users\lmazuel\AppData\Local\pip\Cache\wheels\4c\3a\10\5e2ef6db79d3785728205a4b5b8348eb41a474ec99505cd865
Successfully built azure-common
Installing collected packages: azure-common
Successfully installed azure-common-1.1.4

However, the same call with –no-cache-dir bypasses the bdist_wheel step:
> pip install --no-cache-dir .\azure-common-1.1.4.zip
Processing d:\vsprojects\azure-sdk-for-python-official\wheelhouse\azure-common-1.1.4.zip
Installing collected packages: azure-common
  Running setup.py install for azure-common ... done
Successfully installed azure-common-1.1.4

It seems to me that pip should always call bdist_wheel, since in theory the wheel building step can be changed to fit the platform (in my understanding of sdist VS egg VS wheel). And so even –no-cache-dir should call bdist_wheel, even if the wheel is not cached at the end.
Pip install of the sdist is not our most common situation since our wheels are universals, but I’m still interesting to improve my pip knowledge 😊

What do you think?

Thanks!

Laurent
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20170324/519b08ef/attachment.html>


More information about the Distutils-SIG mailing list