[Python-Dev] PEP 441 - Improving Python ZIP Application Support

Barry Warsaw barry at python.org
Tue Feb 17 19:44:49 CET 2015


I'm just now catching up on this thread, so hopefully these thoughts are still
relevant.

IIRC, the PEP has been scaled back to mostly a convenience around packing an
existing directory into a .pyz file, and (on Windows) adding an association
for those as executable Python zip file.  To the extent that I care about
Windows, +1.

I don't know exactly what the procedure would be to claim .pyz for *nix,
e.g. updating /etc/mime.types, but I think the PEP should at least mention
this.  I think we want to get as official support for .pyz files on *nix as
possible.

The broader question of pex, pyzaa, etc. is an important one for Python,
IMHO.  Having a standard single-executable distribution story will help Python
continue to compete on platforms that work beyond the distribution models
we've come to think about.  App models, and transactional systems such as
Ubuntu Core, etc. are gaining mindshare and Python's traditional way of
deploying applications doesn't really fit very well, and that may discourage
developers from using Python.

Whether Python itself wants to put a stake in the ground today for that is an
open question, but adding support in Python for extension modules in zips
(whether via save-to-disk or new operating system APIs) would be useful to
explore.

I happen to like pex, but what I really want is something like:

$ pyvenv foo
$ source foo/bin/activate
$ pip install coolthing
$ pyzip -o coolthing.pyz .
$ deactivate
$ ./coolthing.pyz

This is outside the scope of PEP 441, but if anybody at Pycon wants to explore
this further, I'm in.

Cheers,
-Barry


More information about the Python-Dev mailing list