[Distutils] Convention for installing binary data files

Brian Takashi Hooper brian@garage.co.jp
Thu, 24 Feb 2000 12:32:32 +0900


Hi Greg, thanks for the quick response!

On Wed, 23 Feb 2000 22:01:49 -0500
"Greg Ward" <gward@python.net> wrote:

> On 23 February 2000, Brian Takashi Hooper said:
> > I was wondering what the convention is for including binary data files
> > with the installation of a module.  Like say I had a table called
> > table.data, that I wanted to have be installed with everything else on
> > python setup.py install - should the data file be part of install_py, or
> > install_ext, or something else?
> 
> Convention?  There is no convention!  Distutils currently handles the
> installation of precisely two types of files: pure Python modules and
> Python extension modules.  Anything else and you're on your own.
Are there any plans to include additional hooks for other stuff?
Another one that I can think of is documentation - is that typically
built as part of the install_ext portion...?  What are other people
doing with this?

I suppose adding the data file install to 'install' would be all right -
it seems like it would be nicer though to be able to have install still
just be the sum of its component targets (install_py and install_ext)...
(or is that not the way it works?)

> 
> The good news is, the system is extensible: it's not too hard to augment 
> the standard "install" command to handle whatever type of file interests 
> you.  See the NumPy setup script distributed with recent versions of
> NumPy for an example; visit this charming URL to see it directly:
> 
>     http://cvs.sourceforge.net/cgi-bin/cvsweb.cgi/Numerical/setup.py?rev=1.8&content-type=text/x-cvsweb-markup&cvsroot=numpy
> 
> Anyways, what is the nature of this data file?  Is it platform-neutral?
> Does it have anything to do with Python, or is it just an artifact of
> your project?  Under Unix, /usr/share/<your-project> or
> /usr/lib/<your-project> would probably be good places for it (depending
> on whether it's platform-neutral or not).
It is a platform-neutral data file - specifically, a character mapping
table (this is for a Japanese encoding package that a colleague of mine
is currently working on)... I guess this would be /usr/lib or
/usr/local/lib then?

Thanks,

--Brian Hoopeer