Next: , Previous: CPAN, Up: Build Factories


4.11.7 Distutils

Most Python modules use the distutils package to provide configuration and build services. The standard build process looks like:

     % python ./setup.py build
     % python ./setup.py install

Unfortunately, although Python provides a standard unit-test framework named unittest, to the best of my knowledge distutils does not provide a standardized target to run such unit tests. (Please let me know if I'm wrong, and I will update this factory.)

The Distutils factory provides support for running the build part of this process. It accepts the same source= parameter as the other build factories.

Arguments:

source
(required): A step specification tuple, like that used by GNUAutoconf.
python
A string which specifies the python executable to use. Defaults to just python.
test
Provides a shell command which runs unit tests. This accepts either a string or a list. The default value is None, which disables the test step (since there is no common default command to run unit tests in distutils modules).