Linux application deployment

Robert M. Emmons RobMEmmons at cs.com
Sun Sep 5 17:14:59 CEST 2004


> What you consider a "best way to deploy linux python app"? I don't want
> to install library modules into user's site-packages, so distutils is no
> help. 
Yes, I agree.  I've noticed that.  It seems to me that the only 
appropriate thing to install in site-packages are libraries to be used 
to basically extend pythong -- not applications.

 > Currently, I change sys.path (adding directory where library
> modules are stored) and I ask users to install application into /opt
> hierarchy, but I don't think it's optimal.

My opinion.  You can install it where you want.  Typically either /opt 
or /usr/local depending if you want to do a merged or separate install. 
  I would layout the package according the the GNU Standard Directory 
structure, and consistent with the Linux Standard Base (or HFS).  That I 
think would mean that you'd put the modules into 
${exec_prefix}/lib/mypackage-xx.yy.zz and then symlink any launch code 
to the appropriate bin/ directory.

I would then reset sys.path to be the right thing in the startup module 
- essentially the launcher.  There are couple of way to do this -- the 
installer can modify the python or sh launch code to hard wire the 
install location or you can do like Gnome does -- have a script that is 
in the path named mypackage-config where you can lookup the setup.

One thing I've always wonders was -- Is there a way for a python module 
to tell where it's file is located???  If you could do this it might 
also be possible to have a python script reset sys.path based on it's 
own location.

Rob



More information about the Python-list mailing list