virtualenv icon indicating copy to clipboard operation
virtualenv copied to clipboard

return exectuable virtualenv wrapper for the sdist distribution of virtualenv or Upload versioned zipapp virtualenv on PyPI or bootstrap site

Open goodwillcoding opened this issue 3 years ago • 12 comments

What's the problem this feature will solve?

Reproducibility ov virtualenv environment using specific virtualenv package (commonly used in devops deployment and other places).

Previously a VERSIONED virtualenv sdist tar.gz file came with standalone virtualenv.py which after extraction of the tar archive could be used to create a rerpoducible virtualenv when combined with --no-download option. That seems to have gone away in recent releases with no good alternatives.

** Solutions**

Reintroduce the virtualenv.py back into the sdist archive

Alternative Solutions

Zipapp application is a great way to install bootstrap tools such as virtualenv. However current distrubtion of virtualenv.pyz is are always of the latest archive and previous versions can not be downloaded.

goodwillcoding avatar Mar 09 '21 18:03 goodwillcoding

We do provide a zipapp https://virtualenv.pypa.io/en/latest/installation.html#via-zipapp

Which you can download versioned from https://github.com/pypa/get-virtualenv/blob/20.1.0/public/virtualenv.pyz?raw=true

gaborbernat avatar Mar 09 '21 19:03 gaborbernat

@gaborbernat I did not know that, I do not think documentation mentions this at all anywhere under https://virtualenv.pypa.io/en/latest/installation.html#via-zipapp. I can do a PR that documentation

That said should not previous versions be available under https://bootstrap.pypa.io/virtualenv/ and possible in PyPI? Does that make sense as a feature

goodwillcoding avatar Mar 09 '21 19:03 goodwillcoding

Perhaps, but only @ewdurbin could set that up 🤔

gaborbernat avatar Mar 09 '21 19:03 gaborbernat

Anything published to the public folder of get-virtualenv at https://github.com/pypa/get-virtualenv/tree/master/public will end up on bootstrap.pypa.io. I'm not sure how PyPI is involved.

ewdurbin avatar Mar 10 '21 02:03 ewdurbin

The files in get-virtualenv overwrite rather than append. So in public, we only have the latest version. Users can still access older versions by using the Github repo API. The question above is it should be worth making that accessible directly from under bootstrap.pypa.io/virtualenv?

gaborbernat avatar Mar 10 '21 07:03 gaborbernat

That's still a decision for the virtualenv/get-virtualenv projects. If y'all would like to update get-virtualenv to publish those in the public folder, bootstrap.pypa.io will happily serve them :)

ewdurbin avatar Mar 10 '21 13:03 ewdurbin

I'm the owner of that project, and I'd not currently like to do that. So the question is more along the lines could bootstrap.pypa.io/virtualenv/version forward to Github archives?

gaborbernat avatar Mar 10 '21 13:03 gaborbernat

aha! :) that is much more actionable question.

what would an ideal redirect look like?

ewdurbin avatar Mar 10 '21 13:03 ewdurbin

Ideally, the following rule:

# from:
https://bootstrap.pypa.io/virtualenv-{version}/{something}
# to:
https://raw.githubusercontent.com/pypa/get-virtualenv/{version}/public/{something}

Where something is a path, for example:

# this
https://bootstrap.pypa.io/virtualenv-20.1.0/3.8/virtualenv.pyz
# forwards to
https://raw.githubusercontent.com/pypa/get-virtualenv/20.1.0/public/3.8/virtualenv.pyz

gaborbernat avatar Mar 10 '21 13:03 gaborbernat

OK, then I guess that's something like

    location ~ ^/virtualenv-([0-9\.]+)/([0-9\.]+)/virtualenv.pyz$ {
        rewrite ^/virtualenv-([0-9\.]+)/([0-9\.]+)/virtualenv.pyz$ https://raw.githubusercontent.com/pypa/get-virtualenv/$1/public/$2/virtualenv.pyz;
    }

in the nginx config?

ewdurbin avatar Mar 10 '21 14:03 ewdurbin

Yeah with the addendum of also supporting:

# this
https://bootstrap.pypa.io/virtualenv-20.1.0/virtualenv.pyz
# forwards to
https://raw.githubusercontent.com/pypa/get-virtualenv/20.1.0/public/virtualenv.pyz

Which makes a part of that optional.

gaborbernat avatar Mar 10 '21 14:03 gaborbernat

one of the reason I suggested uploading the .pyz file to PyPI is because it's sort of a natural place for it to be, it is still a package. Not sure if PyPI supports such uploads though

goodwillcoding avatar Mar 10 '21 17:03 goodwillcoding

Closing as per above.

gaborbernat avatar Jun 27 '23 03:06 gaborbernat