-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide a get-pip.py
-like script for virtualenv
#1
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Just add a comment if you want to keep it open. Thank you for your contributions. |
I still think this is a good idea |
@asottile make a PR with tests, add it to the documentation and we're ready then 👍 |
sounds good! as for design there's kind of two options -- which would you prefer:
(1) seems like a better idea but would like to get your opinion before working on it |
I would prefer the second, cleaner. Note we might need to call a wheel build though, going ahead we no longer support sdist evaluation (as I'd like the horrible one file we have now split up and concatenated during build rather than on the repo, this would drop need of doing current embedded hack). That being said would it be possible to use pypi wheel as download as opposed to a GitHub file? |
option 1 is nice though if you don't have a network connection (think: vendor file in repo, able to create venvs without dependencies) -- doing the wheel would be fine as well (I was just using the sdist in my script for no good reason at the time) |
I would still go down the path of wheel extract, python can natively unzip it. I mean the user will have to get the repo in some way or another, so some network must exist, not? |
Unless you're on macos :( it's crippled ssl implementation can't talk to pypi by default with just stdlib |
isn't github also https? |
Yes but (for now) doesn't require tls 1.2 or whatever |
And |
Oh I see, in that case we just need to use either pip or curl, not? |
Then it fails the "bootstrap from just python" aspect :S |
Somehow you need to get the bootstrapper on the machine though, not? |
yeah, but once you have the bootstrapper it should be able to do everything itself -- even my script above fails that category until you've got a decently-compiled python on macos (brew for instance) this is why I'm leaning towards option 1 |
Isn't the wheel (perhaps wrapped beside a simple python script) able to do everything? |
yes, that's what I'm proposing :) |
I'm on board with that. It could be another artefact we build upon release? Should we publish it on PyPi, or Github? |
I was hoping it could end up on |
Let's have it ready then, and we'll try to get it up there. That being said from what we talked wouldn't it be |
could either be |
The zipapp format has been supported since Python 2.6 - the only new parts in PEP 441 were the zipapp helper library for creating them, and the |
oh perfect, that makes this even easier I think |
Yeah, I think Py2.4 was still in broad use back when get-pip.py was designed, so you have nicer options available to you now :) |
If someone does the work for packaging virtualenv in a zipapp for installation, it might be useful to consider adopting the same approach for pip too. Though, I'm not sure how the transition would be done. "Modernize |
For information, it's possible to bundle I've not tried it for pip, but it may well work there - either for a standalone pip, or as a get-pip equivalent... |
got it working, would like some feedback before I write up news entries / decide further on the approach: pypa/virtualenv#1287 |
We now have https://github.com/pypa/get-virtualenv, we just need to follow the logic from https://github.com/pypa/get-pip and deploy the zipapp generated from here 👍 |
I want to pick this up again and make it happen -- what needs doing here 😁 |
I think for virtualenv we don't need any of the complexity of |
I guess there are 2 different possibilities:
I assume what's wanted here is (1), and a pyz is a fine solution for that. Most of the complexities of |
yeah, I already did the work to make the zipapp for this purpose (1) -- I believe all that's needed is a place to stick it and docs that point at it (and a procedure to update it) |
@asottile We're on the issue tracker of exactly that repository :P |
Oh, nvm me. I need sleep. 😴 |
I was hoping too 👍 |
I believe so 🤔 though maybe a zipapp is enough here, what's your use case? |
yeah the zipapp should be enough, just need to get it hosted |
So I'll try to set this up with |
So here's the proposal. Once this ticket is delivered we'll enable the following functionality: # download a self-packaged virtualenv
curl http://bootstrap.pypa.io/get-virtualenv.pyz
# point a python to it, and you're ready to create virtual environments
python get-virtualenv.pyz --help Proposed behaviour:
get-virtualenv/
├── virtualenv.pyz
├── 2.7
│ └── virtualenv.pyz
├── 3.4
│ └── virtualenv.pyz
├── 3.5
│ └── virtualenv.pyz
├── 3.6
│ └── virtualenv.pyz
├── 3.7
│ └── virtualenv.pyz
├── 3.8
│ └── virtualenv.pyz
└── 3.9
└── virtualenv.pyz
@ewdurbin can help set up this link from |
sounds good, looks a lot like how |
Currently this will end up being a bit of a headache to maintain. bootstrap.pypa.io currently pulls in three repositories
and merges them via symlinks:
You can see the way it is currently configured/managed here. Adding virtualenv to the mix in this way will require all kinds of additional symlinks and purges and kind of makes me think it's time to rethink the way that bootstrap.pypa.io is constructed a bit. It seems setuptools and buildout just have a single file, so I guess they can remain the same at the moment, but for get-pip and get-virtualenv I think it would make sense for us to restructure a bit by adding a For get-pip that directory would basically be
and for get-virtualenv, based on @gaborbernat's sketch above:
Then, give each a link with their name in the top level of bootstrap.pypa.io:
In an ideal world, that'd be that! If you want to boostrap pip, But for backwards compatibility, we'd need to reconstruct the existing links. Some automation could scan the publish directories to create the top level version directories of existing projects, but if we want to make adding additional projects to boostrap.pypa.io a thing, it might make sense to move away from everything sharing the top level. Would urls like |
Alternatively, I suppose we could leave the "latest and greatest" in the top level |
@dstufft @pradyunsg @pfmoore it looks like y'all have been active in preparing/releasing things to bootstrap.pypa.io for get-pip and setuptools, thoughts on this? |
I'm personally happy with both proposals. What I'd like to achieve here is to have a link at root level-ish, that points to the latest. Then have one more in a subdirectory (path in case of URL), that would link to the latest that supports that |
Ah, I thought I'd already responded (twice!) Overall, I like the idea of making a directory in the repository be the public-facing directory, instead of depending on finer details of the repository's layout. The main change I suggest is that we call the directory I think we should probably discuss the get-pip specific things (like maintaining existing routes) on the get-pip issue tracker: I've filed pypa/get-pip#61 for that. |
Noting that we'd probably want to add digests and/or signatures for the files as well. This reorganization has the benefit of making that easier to deploy/work on. (see pypa/get-pip#47 and pypa/get-pip#41) |
I've added to this repository the files as suggested, https://github.com/pypa/get-virtualenv/tree/master, version |
@gaborbernat assuming that some tooling will eventually be added to the repository, I think the structure needs to be changed a bit to have a |
@ewdurbin just to confirm, should we move everything as it is within a public folder at the root of the repository? 👍 |
I believe so, with the exception of the README |
As per agreement from #1. Signed-off-by: Bernat Gabor <bgabor8@bloomberg.net>
Done via #3 |
OK, this is being served on bootstrap.pypa.io as of python/psf-salt@ab57d3e @gaborbernat it looks like the symlinks in git weren't correct though, I resolved that in #4 |
This is now live, thanks for all help, especially @ewdurbin ! |
Nice 👍 |
I often find myself on a machine with near-zero permissions (or a chroot / docker container) and have used this script: https://github.com/asottile/asottile.github.io#bootstrap-a-virtualenv-from-nothing
Would love to get this or something like this hosted similar to
get-pip.py
The text was updated successfully, but these errors were encountered: