[Distutils] Checking distutils features

M.-A. Lemburg mal@lemburg.com
Mon Jun 11 06:42:00 2001

Juergen Hermann wrote:
> Hi!
> I needed this in my setup.py to support distutils 1.0.1:
> if hasattr(distutils.dist.DistributionMetadata, 'get_keywords'):
>     setup_args['keywords'] = "wiki web"
> if hasattr(distutils.dist.DistributionMetadata, 'get_platforms'):
>     setup_args['platforms'] = "win32 posix"
> apply(setup, (), setup_args)
> Is there a more official way?

I don't think so... you will have to override the DistributionMetadata
class inplace, that is before even running setup(). Changes to
the compiler classes require the same procedure.

I think we ought to make distutils more customizable in this
respect too, e.g. by providing a generic class lookup dictionary
(much ilke the cmdclass dict) in the setup() call as keyword
parameter which then allows overriding compiler classes and
other classes for which there is no general hook.

Another thing which I stumbled across is that there seems
to be no way to define the order of calling the various
commands, e.g. to insert a new command into the
general flow of execution.

Marc-Andre Lemburg
CEO eGenix.com Software GmbH
Company & Consulting:                           http://www.egenix.com/
Python Software:                        http://www.lemburg.com/python/