2.3 How building works

As implied above, the build command is responsible for putting the files to install into a build directory. By default, this is build under the distribution root; if you're excessively concerned with speed, or want to keep the source tree pristine, you can change the build directory with the --build-base option. For example:

python setup.py build --build-base=/tmp/pybuild/foo-1.0
(Or you could do this permanently with a directive in your system or personal Distutils configuration file; see section .) Normally, this isn't necessary.

The default layout for the build tree is as follows:

--- build/ --- lib/
or
--- build/ --- lib.<plat>/
               temp.<plat>/
where <plat> expands to a brief description of the current OS/hardware platform and Python version. The first form, with just a lib directory, is used for ``pure module distributions''--that is, module distributions that include only pure Python modules. If a module distribution contains any extensions (modules written in C/C++), then the second form, with two <plat> directories, is used. In that case, the temp.plat directory holds temporary files generated by the compile/link process that don't actually get installed. In either case, the lib (or lib.plat) directory contains all Python modules (pure Python and extensions) that will be installed.

In the future, more directories will be added to handle Python scripts, documentation, binary executables, and whatever else is needed to handle the job of installing Python modules and applications.

See About this document... for information on suggesting changes.