The distutils.core module is the only module that needs to be installed to use the Distutils. It provides the setup() (which is called from the setup script). Indirectly provides the distutils.dist.Distribution and distutils.cmd.Command class.
arguments) |
The setup function takes a large number of arguments. These are laid out in the following table.
argument name | value | type |
---|---|---|
The name of the package | a string | |
The version number of the package | See distutils.version | |
A single line describing the package | a string | |
Longer description of the package | a string | |
The name of the package author | a string | |
The email address of the package author | a string | |
The name of the current maintainer, if different from the author | a string | |
The email address of the current maintainer, if different from the author | ||
A URL for the package (homepage) | a URL | |
A URL to download the package | a URL | |
A list of Python packages that distutils will manipulate | a list of strings | |
A list of Python modules that distutils will manipulate | a list of strings | |
A list of standalone script files to be built and installed | a list of strings | |
A list of Python extensions to be built | A list of instances of distutils.core.Extension | |
A list of Trove categories for the package | XXX link to better definition | |
the Distribution class to use | A subclass of distutils.core.Distribution | |
The name of the setup.py script - defaults to sys.argv[0] |
a string | |
Arguments to supply to the setup script | a list of strings | |
default options for the setup script | a string | |
The license for the package | ||
Descriptive meta-data. See PEP 314 | ||
A mapping of command names to Command subclasses | a dictionary |
script_name[, script_args=None , stop_after='run' ]) |
script_name is a file that will be run with execfile()
sys.argv[0]
will be replaced with script for the duration of the
call. script_args is a list of strings; if supplied,
sys.argv[1:]
will be replaced by script_args for the duration
of the call.
stop_after tells setup() when to stop processing; possible values:
value | description |
---|---|
Stop after the Distribution instance has been created and populated with the keyword arguments to setup() | |
Stop after config files have been parsed (and their data stored in the Distribution instance) | |
Stop after the command-line (sys.argv[1:] or
script_args) have been parsed (and the data stored in the
Distribution instance.) | |
Stop after all commands have been run (the same as if setup() had been called in the usual way). This is the default value. |
In addition, the distutils.core module exposed a number of classes that live elsewhere.
A short description of each of these follows, but see the relevant module for the full reference.
The Extension class describes a single C or C++extension module in a setup script. It accepts the following keyword arguments in its constructor
argument name | value | type |
---|---|---|
the full name of the extension, including any packages -- ie. not a filename or pathname, but Python dotted name | string | |
list of source filenames, relative to the distribution
root (where the setup script lives), in Unix form (slash-separated) for
portability. Source files may be C, C++, SWIG (.i), platform-specific
resource files, or whatever else is recognized by the build_ext
command as source for a Python extension. |
string | |
list of directories to search for C/C++ header files (in Unix form for portability) | string | |
list of macros to define; each macro is defined
using a 2-tuple, where 'value' is either the string to define it to or
None to define it without a particular value (equivalent of
#define FOO in source or -DFOO on Unix C
compiler command line) |
(string,string)
tuple or (name,None ) | |
list of macros to undefine explicitly | string | |
list of directories to search for C/C++ libraries at link time | string | |
list of library names (not filenames or paths) to link against | string | |
list of directories to search for C/C++ libraries at run time (for shared extensions, this is when the extension is loaded) | string | |
list of extra files to link with (eg. object files not implied by 'sources', static library that must be explicitly specified, binary resource files, etc.) | string | |
any extra platform- and compiler-specific information to use when compiling the source files in 'sources'. For platforms and compilers where a command line makes sense, this is typically a list of command-line arguments, but for other platforms it could be anything. | string | |
any extra platform- and compiler-specific information to use when linking object files together to create the extension (or to create a new static Python interpreter). Similar interpretation as for 'extra_compile_args'. | string | |
list of symbols to be exported from a shared
extension. Not used on all platforms, and not generally necessary for
Python extensions, which typically export exactly one symbol: init +
extension_name. |
string | |
list of files that the extension depends on | string | |
extension language (i.e. 'c' , 'c++' ,
'objc' ). Will be detected from the source extensions if not provided.
|
string |
See the setup() function for a list of keyword arguments accepted by the Distribution constructor. setup() creates a Distribution instance.
See About this document... for information on suggesting changes.