[Distutils] using distutils for an application

M.-A. Lemburg mal@lemburg.com
Tue Apr 24 12:05:10 2001


Philippe FREMY wrote:
> 
>         Hi,
> 
> I have developped an application with Python and PyQt (klotski, see
> http://klotski.berlios.de/klotski/) and was faced with the problem of
> distribution.
> 
> I was told to look at distutils but this wasn't the answer to my problems.
> 
> 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, but it should
be possible to tweak the implementation according to your needs
by subclassing distutils commands.
 
> 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.

> - how to start the program ? Use a loader ? Tell people to run  python
> klotski.py ?

Right.

> - 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.

> - how to load the data that have been installed (find their location at
> runtime) ?

Depends on how you configure install_data.
 
> I solved all this using a shell script loader and a Makefile to install
> everything under /usr/share for Unix. For windows, I just left everything in
> the same directory.

This seems like a reasonable way to do it. distutils should be
able to emulate your Makefile easily (after all, it's using Python).
 
> I wonder if you have advices regarding this kind of problem and if they are
> going to be adressed by distutils or if it is considered to be too much
> os-specific.
> 
>         regards,
> 
>         Philippe
> 
> ps: I am not subscribed, so please cc me any answer.
> 
> _______________________________________________
> Distutils-SIG maillist  -  Distutils-SIG@python.org
> http://mail.python.org/mailman/listinfo/distutils-sig

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