virtualenv icon indicating copy to clipboard operation
virtualenv copied to clipboard

zipapp: could have a shebang

Open asottile opened this issue 6 years ago • 6 comments

https://docs.python.org/3/library/zipapp.html#zipapp.create_archive

in particular the interpreter argument -- should we set something for it?

that way someone could do:

curl -o virtualenv.pyz
chmod +x virtualenv.pyz
./virtualenv.pyz venv

asottile avatar Feb 07 '20 17:02 asottile

I'm reluctant on this; this would encourage running things like that, but that can only work on UNIX; I kinda prefer the explicit over implicit interpreter here? Any strong arguments against?

Edit: What would be a sane value for that? Just python?

gaborbernat avatar Feb 07 '20 17:02 gaborbernat

yeah I guess that's a good point, it's hard to pick a good interpreter here -- maybe python3?

or just scrap this :man_shrugging:

asottile avatar Feb 07 '20 17:02 asottile

Doesn't the py launcher for Windows know how to read pyz shebang also?

dholth avatar Feb 07 '20 18:02 dholth

Yeah, it knows. But what should be the shebang value that's sane on all platforms? Feels like that's more useful when you know your target python, e.g. you control where you deploy the zipapp.

gaborbernat avatar Feb 07 '20 19:02 gaborbernat

Just python?

Should be, yea. For the versioned URLs, we could add the shebangs with per-interpreter names (python3.8). I think py.exe is smart enough to translate those, even for pyz files -- but it wouldn't hurt to make sure before we actually change stuff. :)

I also think we can change names on the get-virtualenv repository if we want to, given that it's still pretty early -- in case we want to have a virtualenv-3.8.pyz. I don't think we do though. :)

pradyunsg avatar Feb 07 '20 20:02 pradyunsg

I'll mark this as something we should do but not blocker for 20.0.0, which is still planned for Monday (we have one blocker issue just for that).

gaborbernat avatar Feb 08 '20 11:02 gaborbernat

Seems no longer an issue as no one reported it in 3 years.

gaborbernat avatar Jun 27 '23 03:06 gaborbernat