[Distutils] Distutils enhancement - set variables from the co mmand line

Moore, Paul Paul.Moore@atosorigin.com
Mon Jul 16 08:50:00 2001

>From: M.-A. Lemburg [mailto:mal@lemburg.com]
> Paul Moore wrote:
>> My suggestion would be to allow the "global_opts" or "cmdX_opts" to
>> arguments of the form key=value. These can be exposed to setup.py as a
>> dictionary, say distutils.args.
>> What do people think?
> Doesn't setup.cfg provide enough means for the user to customize the
> distutils behaviour ?

Not really. As far as I can see from the documentation, it allows the user
to set existing command line options. It doesn't allow the user to supply
arbitrary configuration information.

The example I hit this with was installing a module which depended on the
JPEG library. On Windows, there is no "standard" location where such a
library would be installed. It is not unlikely, however, that the user might
have built the library just to install this extension - so a reasonable
default might be ..\jpeg-6b. So I envision setup.py having something like:

    JPEG_LOCN = distutils.args.get('JPEG_LOCN', '../jpeg-6b')

The user can then either run

    python setup.py build
    python setup.py build JPEG_LOCN=C:\LocalLibs\JPEG

depending on his setup.