To download wheel dependencies for various offline machines using a laptop in a cafe with a dicey flakey Internet connection, I would like to know the URLs of the files to fetch so I can use a more robust tool like aria2.
A command like the following is very fragile:
$ python -m pip download --verbose -d ./wheel_cache/ argostranslate
It can only handle the job if the uplink is fast and reliable. The logs of a download look like this:
…
Collecting sacremoses<0.2,>=0.0.53
Downloading sacremoses-0.1.1-py3-none-any.whl (897 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 897.5/897.5 kB 645.5 kB/s eta 0:00:00
…
It’s a shame the URLs are concealed despite having verbosity, even when there are errors (which is when the URL is most needed). These docs show no way of increasing log verbosity.
UV – not ideal but the UV method still worth discussion
I heard a suggestion that UV could likely reveal the URLs. UV is becoming a popular replacement for pip* tools. But for me it’s not mature or popular enough (judging by non-existence in official Debian repos). For the record, it would still be interesting to document how to use UV to derive the URLs.
Hacking
I am most interested in deriving the URLs using Debian-supported apps. Hacker methods welcome. E.g. clever use of strace with a pip* command. Though I don’t strace would see URLs, perhaps something like privoxy or socat would. Of course this could be quite tedious because the pip* commands have no simulation mode, so pip must first be given an opportunity to fetch every file. When a fetch fails on one file, it terminates, which would force us to feed 1 URL to Aria2 at a time and do a manually intensive serial procedure.


Thanks! I noticed
python3-unearthis a debian pkg so that looks like a good first approach for me to try.