[Distutils] PyPi’s predictable download url

Nick Coghlan ncoghlan at gmail.com
Wed Jul 26 11:08:36 EDT 2017


On 27 July 2017 at 00:52, Alexander Belopolsky
<alexander.belopolsky at gmail.com> wrote:
> On Wed, Jul 26, 2017 at 10:21 AM, Nick Coghlan <ncoghlan at gmail.com> wrote:
>> .. the most robust option is to instead let a dedicated client tool like pip
>> handle the problem:
>>
>> * pip install: retrieve *and* install a component
>> * pip download: just retrieve the files without installing them locally
>
> This is a sound advise in general, but the specific issue here is how
> to bootstrap virtualenv for python 2.7 on the systems with
> missing/broken pip?  Note that "ensurepip" may not be an option for a
> user without root privileges.

    python -m ensurepip --user

should still work in that case (since it installs inside the user's
home directory and leaves the system site-packages alone).

As far as direct *file* downloads go, no, those URLs aren't readily
calculated at all - automated clients are required to look them up via
the index page for the package (e.g.
https://pypi.org/simple/virtualenv/ for virtualenv).

For virtualenv, the full URL for the 15.1.0 wheel file for example is
https://files.pythonhosted.org/packages/6f/86/3dc328ee7b1a6419ebfac7896d882fba83c48e3561d22ddddf38294d3e83/virtualenv-15.1.0-py2.py3-none-any.whl#sha256=39d88b533b422825d644087a21e78c45cf5af0ef7a99a1fc9fbb7b481e5c85b0

To get a *human* to the right set of files, though, you'll want to
link them to https://pypi.org/project/virtualenv/#files

Cheers,
NIck.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia


More information about the Distutils-SIG mailing list