FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora Development

 
 
LinkBack Thread Tools
 
Old 05-05-2008, 06:26 PM
Toshio Kuratomi
 
Default python packaging - icons/desktop files and /usr/bin accessibility

Mary Ellen Foster wrote:

On Mon, May 5, 2008 at 1:32 PM, David Timms <dtimms@iinet.net.au> wrote:

I'm packaging a basic python program, and request some guidance:

1. the app has three main .py programs, and another 10 or so .py modules.
My installed rpm puts these in site-packages/appname which I understand the
guidelines to require. Problem is these are not accessible as a user because
they aren't on the path.
So it works if I /usr/lib/python../site-packages/myapp/app1.py

Should I be messing with the path ?
Creating a shell script for each of the main programs, and dropping them in
/usr/bin ?


Note that if you want the libraries to be available to Python, as far
as I understand it, the standard way to do this is to a "*.pth" file
and put it into site-packages. For example, for my package (which puts
files into an "Ice" subdirectory), I created a file called ice.pth
containing only the following:
Ice
For yours, you probably want to create "myapp.pth" containing the line
"myapp" and install that into site-packages.

This doesn't answer the question of how to run the programs, though, of course.

Personally, I avoid .pth files when possible because of the performance
hit that they cause. I'd much rather set PYTHONPATH individually for
each application that needs to know about a special path. For doing
this in python, you can look at /usr/bin/yum. For doing it in bourne
shell /usr/bin/gramps (from the gramps package.)


ice may be a special case because it is a module requiring another
module although I need to look a little closer at that. Something looks
fishy about what python-ice is doing.


Also note that this particular case doesn't seem to need a .pth
file/PYTHONPATH changes as, if I'm reading it correctly, the module is
being installed into site-packages which python searches under normal
circumstances. It's just that the application file itself is also being
installed into site-packages so invoking the application fails to find
/usr/bin/APPNAME.


-Toshio

--
fedora-devel-list mailing list
fedora-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-list
 

Thread Tools




All times are GMT. The time now is 09:08 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org