[Distutils] EasyInstall: scripts

Phillip J. Eby pje at telecommunity.com
Mon May 30 02:01:46 CEST 2005

At 04:43 PM 5/29/2005 -0700, Bob Ippolito wrote:
>On May 29, 2005, at 3:46 PM, Phillip J. Eby wrote:
>>It might help if there were some kind of metadata for scripts, like to
>>indicate whether something is a command-line utility, a graphical
>>application, etc.  Then distutils could tweak the file extension
>>build a custom launcher for it (like Fredrik Lundh's exemaker for
>>as appropriate for the platform.  That information could then be
>>added to
>>EGG-INFO and/or EGG-SCRIPTS, and used by EasyInstall to do script
>>installation and uninstallation.
>Couldn't you change build_scripts and install_scripts when using
>bdist_egg to instead put the script inside the egg somewhere, and the
>installer would put scripts in the usual places that simply require
>and then exec the real script?

That's more or less what I was proposing, except that I wouldn't use 
build_scripts or install_scripts, just pack the original source scripts 
into the egg, and then let the installer do its thing at the other 
end.  That way, a cross-platform egg wouldn't have any platform-specific 
stuff baked into the scripts accidentally.

It's not as if build_scripts or install_scripts do anything of consequence 
at the moment anyway; they just munge the #! line and copy the files (as of 
Python 2.3 anyway).

My main thought is distinguishing console vs. GUI start scripts.  I don't 
believe there's a Mac equivalent to '.pyw', for example.  Also, at some 
point EasyInstall really could support adding desktop shortcuts (or Start 
menu entries or whatever you call them on a given platform) for 
applications bundled in eggs.  Sort of an end-user py2exe/py2app thing.

On the other hand, it does seem a little silly to use a command-line tool 
to install a graphical application.  :)  However, it probably makes sense 
to create platform-specific GUI wrappers around EasyInstall to do this sort 
of thing.

More information about the Distutils-SIG mailing list