Command to know what file would be downloaded for a requirement
See original GitHub issueWhat’s the problem this feature will solve?
I want to know what version (and potentially ahich artifact) would be downloaded/installed when I pip install
a package. Currently I do something like pip download --no-deps --dest %TMP%
and read the output, but that can take a long time if the package is large (e.g. numpy).
Describe the solution you’d like
Something like pip find numpy
to only execute the finding part, but instead of downloading (and inspecting) the package, print the link that would be downloaded instead:
$ py -3.7 -m pip find numpy
https://files.pythonhosted.org/packages/4e/9d/c129d78e6b942303b762ccfdf1f8339de80c5e6021b14ef0c99ec5bdc6aa/numpy-1.16.3-cp37-cp37m-win_amd64.whl
Alternative Solutions
My current approach is described above. Alternative design includes pip install --dry-run
, but that does not feel right because it implies dependency resolution (which requires the package to be downloaded).
An alternative output is to list all applicable links, instead of only the best match.
Additional context
A command that automatically download packages (to a temporary location) and produce a requirements.txt could be useful as well, but I can write a script using existing pip commands easily enough, so pip don’t really need to provide that functionality.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:12 (12 by maintainers)
Top GitHub Comments
I think so, yes.
Neither
pip index version
now and #10052 covers what I originally needed. I was looking for the information “what file will be downloaded when I install this requirement”. Both features you linked only operate at the version level, but I need the information at the file level. Numpy 1.16.3, for example, contains 22 wheels and 1 sdist, I want to know which one will be selected.