[Distutils] Python people want CPAN and how the latter came about

David Cournapeau cournape at gmail.com
Wed Dec 23 05:12:30 CET 2009


On Tue, Dec 22, 2009 at 10:35 PM, Tarek Ziadé <ziade.tarek at gmail.com> wrote:

>
> When you say "which could be solved relatively easily" I suggest that
> you take the time to add concise and precise proposals in
> bugs.python.org so I can work on them.

Technically, it is easy. Only have two mechanisms for data files: one
for installed data files, and one for extra source files (as done in
automake for example):
 -  Extra files only need to be listed (and included in sdist)
 -  Install data files need a target directory. One of the problem
with distutils here is that you can only hardcode paths - in my own
packaging solution, I use $path variables so that any path defined
internally can be reused ($bindir, etc...); something similar could be
defined in distutils. The remaining issue is then how to resolve the
final target: installing src/foo.dat into $datadir installs
$datadir/src/foo.dat or $datadir/foo.dat ? In my own package, I use a
source directory argument, to reproduce the nobase scheme of automake:

http://sources.redhat.com/automake/automake.html#Basics-of-Installation

The way I did it is to have:

target=/usr/include
source=include
files=foo.h,sys/bar.h

The files include/foo.h is installed as /usr/include/foo.h and
include/sys/bar.h is installed as usr/include/sys/bar.h (the full path
in the file sections is appended to target)

If you want to install bar.h as /usr/include/bar.h, you would need two sections:

target=/usr/include
source=include
files=foo.h

And

target=/usr/include
source=include/sys
files=bar.h

Assuming you can use $path in target, this can describe any scheme I
can think of, and I don't think it can be made simpler (I would be
happy to know of a simpler solution though).

cheers,

David


More information about the Distutils-SIG mailing list