virtualenv
virtualenv copied to clipboard
return exectuable virtualenv wrapper for the sdist distribution of virtualenv or Upload versioned zipapp virtualenv on PyPI or bootstrap site
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.
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 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
Perhaps, but only @ewdurbin could set that up 🤔
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.
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?
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 :)
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?
aha! :) that is much more actionable question.
what would an ideal redirect look like?
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
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?
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.
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
Closing as per above.