[Distutils] command hooks...

Robert Park rbpark at exolucere.ca
Wed May 23 08:16:01 CEST 2012

On Mon, May 21, 2012 at 3:42 PM, Tarek Ziadé <tarek at ziade.org> wrote:
> If you are a packager for a project, you can describe in details your data
> files, and add more metadata that are understood by PyPI.
> If you are a debian packager, you will be able to define where the data
> files of a python project should be installed without having to patch some
> python code.

This right here is the killer feature for me. By my limited
observations, most people solve the data files problem either by
dumping their data files inside their python modules (which is an ugly
abuse of the filesystem), or are simply using the cumbersome autotools
in order to record the installation prefix for their data files. It
blows my mind that it is standard practice for many GNOME apps written
in Python to use a C compilation preprocessor in order to set a python
variable so their python scripts can find their data files.

Currently I am hacking distutils in order to accomplish this, like so:


But this is ugly because it modifies the file in-place, so I always
have to be careful not to accidentally commit the munged file into my
git repo.

It's absolutely critical that any replacement for distutils have
built-in functionality for installed python code being able to query
at run-time the location that data files were placed at install time.


More information about the Distutils-SIG mailing list