[Distutils] using distutils for an application

M.-A. Lemburg mal@lemburg.com
Thu Apr 26 09:34:00 2001

Philippe FREMY wrote:
> > >
> > > Distutils is very module centric. It is very efficient to
> > install a module
> > > but doesn't answer the needs of installing applications.
> >
> > It wasn't designed for packaging applications,
> >
> Reading the SIG intruduction:
> "The goal of the Distribution Utilities (`distutils') is to make building,
> distributing, and installing Python modules, extensions, and applications
> painless and standardized."
> I see the word "applications" there :-)

Well, eventually distutils will also be able to package and
install applications, but we're still not quite there yet (even
though Thomas' py2exe is already heading in that direction).
> > > The problems I had are:
> > > - where to install the program data ?
> >
> > distutils has a command install_data for this which you may want
> > to use.
> I didn't see it or was unable to use it. Is it really possible to install
> data and then load them at runtime without any problem ?

The command is not really well-defined yet, e.g. to be able to
make some use of it, I had to subclass it too for my mx stuff.
> > > - how to make the program visible to the underlying os (Menu, etc) ?
> >
> > On Windows, you would add a Menu entry... I'm not sure how
> > this is done and whether distutils has any support for this.
> > On Unix, there is no standard method for this. Not sure
> > about Macs.
> This is exactly the point I would like to make. There is no standard method
> _yet_. But I think it should be worked out.

Don't you think that professional installers do a better job
here ? E.g. distutils could create the setup scripts for these
installers rather than try to mimick all the works itself.

> > but it should
> > be possible to tweak the implementation according to your needs
> > by subclassing distutils commands.
> This should not be a tweak every different program has to rewrite. A
> handwritten unstandard installation method is not a good idea.
> There are more and more applications developed with python today, especially
> since there are more graphical toolkits available : PyQt, PyGtk, PyGnome,
> PyWxWindow, Tkinter, etc.
> A standard way of distributing a python application is really needed. There
> is not that much to define, given how much has already been done with
> DistUtils:
> - define where to install runtime data and how to load it
> - define perhaps how to store and load user data
> - provide a way to install the program in the standard menu system:
>    -> gnome, kde, windows, mac, ...
>    On unix, this could be configurable and left up to the guy installing the
> program to
>    decide for what environment he want a menu entry.
> What do you think about this ?

Sounds like a huge project. Note that these kind of ideas will
only make it into production code if someone stands up and
just does the job (like Greg Ward did <big horray to Greg ;->).

The finishing can then be done be the community, but the
general wrapup of initial code has to be done by one or two
persons working closely together.

Marc-Andre Lemburg
Company & Consulting:                           http://www.egenix.com/
Python Pages:                           http://www.lemburg.com/python/