[Distutils] People want CPAN

Tarek Ziadé ziade.tarek at gmail.com
Fri Nov 13 00:47:35 CET 2009

On Thu, Nov 12, 2009 at 11:45 PM, David Cournapeau <cournape at gmail.com> wrote:
> I think I was confusing with my rpath example, which may be the source
> of our misunderstanding. I don't want to add a --prefix option to
> build_ext. I want to support the following user cases:
> python setup.py build # here, prefix would be whatever default, as
> available from sysconfig
> python setup.py install --prefix=foo # here, prefix would be the one
> as computer by install command
> python setup.py build_ext -i # here prefix is the current directory
> Requiring users to handle new options of commands is impractical IMHO,
> and a prefix option to build has a strange feeling to it.

I am not sure to follow here: let's forget about your example where
you call build_src and install together.

-> in the real world, how a --prefix passed to install is going to
impact a build command and vice-versa ?

install just copy files, where it's told to copy them, and build does
some work with some options,
and as a matter of fact you seem to use installation prefix at this stage.

So, if you are not *installing*, it doesn't make sense to call the
*install* command, and build could
have its --prefix option in your case.

>> Remember that the build step has nothing to do with the install step
> Ideally, what we want here is like autoconf does it. You have a
> configure step, and then at build/install stages, you have access to
> *all* options. Those options can be customized at build through usual
> make mechanism, but this is taken into account as well without the
> makefile writer having to care.
> IOW, we need to know *all* the finalized options *before* the first
> build command is even run.

So, IOW, these options cannot be finalized by *any* command. So the
proposal I've made
to have global options that are common to all commands, and that can
be used to create
an execution environment through public APIs would help in there.

So if the install command transforms "prefix" into "path1" "path2" and
"path3", we need this transformation
to occur outside install, so it can be done before the commands are run.

that is:

$ python setup.py --prefix=foo cmd1 cmd1 etc

and the result would be in Distribution.options = {'path1': xxx, 'path2': xx}


More information about the Distutils-SIG mailing list