propagating distutil user options between commands

G

gatti

When building a C extension, Distutils standard command 'install' calls
the 'build' command before performing the installation (see
Lib/distutils/command/install.py and build.py).
Reusing the build command is the correct way to ensure the installation
payload is ready, but the two commands support very different sets of
user options and it is impossible to combine them: install validates
them at the beginning, rejecting user options meant for build as
"unrecognized".
This becomes a problem with necessary build options like --compiler;
there is an easy workaround for my specific case (running setup.py
twice: "build --compiler=..." then "install --skip-build"), but
--skip-build is an ad hoc option, other combinations of commands and
options can have the same problem.
There are systematic solutions, like letting every option propagate to
subcommands without checking, on the assumption that unrecognized
options do no harm, or labeling options by command (e.g. setup.py
install --build:compiler=foo --install_scripts:force) to let every
command validate its options only and limit options to specific
commands as a byproduct.
What are the reasons for the current strict policy in Distutils? Can it
be changed?

Lorenzo Gatti
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,264
Messages
2,571,328
Members
48,013
Latest member
fmb_amith

Latest Threads

Top