python packaging - icons/desktop files and /usr/bin accessibility

Toshio Kuratomi a.badger at gmail.com
Mon May 5 21:54:06 UTC 2008


Mary Ellen Foster wrote:
> 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.
> 
I took a closer look at Ice and I think there's a few things that should 
change.

1) AFAICS there's no reason for the python bindings to be part of the 
Ice package.  It comes in a separate tarball and appears to build on its 
own.  I can't find a mention of this in the review so I don't know if 
there's something special about it that I'm missing. [1]_

2) The .pth file looks like it's being used to compensate for bad 
imports and upstream packaging.
   * There should be an __init__.py file in 
%{_libdir}/pythonX.Y/site-packages/Ice

   * The following files have imports that need to be changed:
     IceBox/__init__.py
     Glacier2/__init__.py
     IceGrid/__init__.py
     IceStorm/__init__.py
     IcePatch2/__init__.py

     change imports like::
       import IceBox_IceBox_ice
     to this::
       from Ice import IceBox_IceBox_ice

3) Additionally, on x86_64, the python module is spread over two 
directories: /usr/lib64/python2.5/site-packages/Ice and 
/usr/lib/python2.5/site-packages/Ice.  Python doesn't handle that very 
well.  All the files of a module should be in a single directory.  Since 
this module builds an ELF shared object (IcePy.so/IcePy.so.3.2.1) all 
files should be installed into %{python_sitearch}/  (This is what lead 
to BZ #392751).

With fixes in #2 and #3 I think the .pth file becomes unnecessary.


.. _[1]: I can do the review for python-Ice if you'd like.  Just add me 
to the CC list once you have it broken out into its own package.

-Toshio




More information about the fedora-devel-list mailing list