distutils possibilities

S

Sridhar R

I learnt that distutils can be used to package python modules and
packages. Fine it does that well.

Suppose I am writing an python application (not package or module),
and suppose that I am using Linux. Where should I install the python
source files and bin scripts and data in my /usr directory?

Should the python (.py) files go into /usr/lib/pythonXX/site-packages
or /usr/lib/myapp or /usr/share/myapp ?

Should the data files go to /usr/share/myapp or anything else?

Should the pixmap files go to /usr/share/pixmaps/myapp?

I can write setup.py to do all these things. But in general are there
any standards for installation directories? Note that I am asking this
for python _applications_ not packages like PIL,Numeric. Hope you get
me. There are python source files, executable scripts (/usr/bin) and
data files distributed in a typical applications.

Finally, since the installation directory can vary (as the sys admin
can customize the prefix and also during development the prefix is
usually current directory), I need pythonic solution for such a
dynamic constants.py file.
In automake world, one would write constants.py.in and transform this
into constants.py. Rememerber constants.py file contain different
values during development (prefix=/home/sri/Projects/myapp) and
different values during deployment (prefix=/usr/) Again, I can follow
my logic, to create such a constants.py script, by coding the logic in
setup.py script and supporting extra command line option. But are
there any standard tool or any support from distutils to do such
things?

Now a bit of relaxation, what abt installtion directories in other
platforms?
 
J

Jorgen Grahn

I learnt that distutils can be used to package python modules and
packages. Fine it does that well.

Suppose I am writing an python application (not package or module),
and suppose that I am using Linux. Where should I install the python
source files and bin scripts and data in my /usr directory?

I believe the Debian people have faced a similar problem, with distutils
versus their packaging procedure and file system standards. Google their
mailing lists for some thoughts on the matter (in case of no reply here).

/Jorgen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,265
Latest member
TodLarocca

Latest Threads

Top