[Distutils] Best practices to package a desktop application
jon at multani.info
Thu Dec 29 16:04:37 CET 2011
I hav a desktop application which currently runs only on Linux using
pyGtk, and is packaged using setuptools/distribute.
It ships with a number of non-Python files:
* documentation (README, Changelog, Authors, etc.)
* .desktop file
* application specific's icons
* one man file
* translation files
* and one executable script
The setup.py file looks like this so far:
('share/myapp', ['README', 'Changelog', 'Authors']),
... numerous other translation files ...
but I somehow have a bad feeling about this, except for the entry point
(which does a great job).
When I run ``python setup.py install --prefix="local"``, everything gets
installed into ``site-packages/myapp/``, Python files and data files,
which seems to be a feature of setuptools/distribute over plain
Distutils, whereas it seems to be "cleaner" to split things as described
by the ``data_files`` setting (and AFAIK, Distutils does just that).
To be clear, I end up with
Whereas I "think" I would like to have this instead, which looks more
organized to me:
Actually, someone reported this "bug" to me, as he was expecting the
latter whereas he got the former.
Also, the application currently uses a custom method to find the
location of those data files (mainly the icons which are used at
run-time). It does a "terrible" job of trying several well-known
locations until it either reaches the file or fails with a laconic
error. I guess using ``pkg_resources`` data-access API would be much
Finally, I'm also concerned about Linux distribution packagers, and I
would like to package the application so that it also useful and easy
for them to repackage and distribute it.
After reading setuptools/distribute and distutils documentations, I'm
still not what is the best way to proceed. Any hints would be greatly
More information about the Distutils-SIG