[Distutils] Import extensions from zipfiles (windows only)

Phillip J. Eby pje at telecommunity.com
Thu Dec 16 16:21:29 CET 2004

At 10:14 AM 12/16/2004 +0100, M.-A. Lemburg wrote:

>I wonder why you put so much effort into avoiding the unzip
>of the file ? What's so bad about it ?

I mostly don't want it to be a manual step.  I think Thomas would also like 
to have the option of py2exe generating single-file "installation-free" 
executables, even if an application includes extensions.  (That's not a 
plugins issue, of course.)

>In the end, the user will want "plugins" to be easily installable,
>e.g. have the application install them for him. For that to
>work, the most important part is a download manager. The rest
>(unzip into the plugin directory) can easily be done using
>standard distutils tools.

Well, as long as they're either unzipped into different directories, or 
there is only one version of each plugin needed.  But, it'd also be nice to 
be able to just put zipfiles on the Python path and share them between 
applications for some plugins.

One big advantage to this is that platform-specific packagers (RPM et al) 
could be made to simply dump the zipfiles in an all-purpose location like 
/lib/pythonXX/site-packages, and not have to worry about version 
conflicts.  A script or application could call a utility routine to add the 
needed items to sys.path at runtime.  Something like 
'require("Twisted>=1.1.0")' to search the existing sys.path for an 
appropriately-named directory or zipfile, and push it on the front of sys.path.

Of course, with the proper metadata in the zipfiles (or their unpacked 
versions), the routine could also search for the necessary dependencies, 
and check for version conflicts.

More information about the Distutils-SIG mailing list