class documentation

class build_ext(Command): (source)

View In Hierarchy

Undocumented

Method build_extension Undocumented
Method build_extensions Undocumented
Method check_extensions_list Ensure that the list of extensions (presumably provided as a command option 'extensions') is valid, i.e. it is a list of Extension objects. We also support the old-style list of 2-tuples, where the tuples are (ext_name, build_info), which are converted to Extension instances here.
Method finalize_options Set final values for all the options that this command supports. This is always called as late as possible, ie. after any option assignments from the command-line or from other commands have been done...
Method find_swig Return the name of the SWIG executable. On Unix, this is just "swig" -- it should be in the PATH. Tries a bit harder on Windows.
Method get_export_symbols Return the list of symbols that a shared extension has to export. This either uses 'ext.export_symbols' or, if it's not provided, "PyInit_" + module_name. Only relevant on Windows, where the .pyd file (DLL) must export the module "PyInit_" function.
Method get_ext_filename Convert the name of an extension (eg. "foo.bar") into the name of the file from which it will be loaded (eg. "foo/bar.so", or "foo\bar.pyd").
Method get_ext_fullname Returns the fullname of a given extension name.
Method get_ext_fullpath Returns the path of the filename for a given extension.
Method get_libraries Return the list of libraries to link against when building a shared extension. On most platforms, this is just 'ext.libraries'; on Windows, we add the Python library (eg. python20.dll).
Method get_outputs Undocumented
Method get_source_files Undocumented
Method initialize_options Set default values for all the options that this command supports. Note that these defaults may be overridden by other commands, by the setup script, by config files, or by the command-line. Thus, this is not the place to code dependencies between options; generally, 'initialize_options()' implementations are just a bunch of "self...
Method run A command's raison d'etre: carry out the action it exists to perform, controlled by the options initialized in 'initialize_options()', customized by other commands, the setup script, the command-line, and config files, and finalized in 'finalize_options()'...
Method swig_sources Walk the list of source files in 'sources', looking for SWIG interface (.i) files. Run SWIG on all that are found, and return a modified 'sources' list with SWIG source files replaced by the generated C (or C++) files.
Class Variable boolean_options Undocumented
Class Variable description Undocumented
Class Variable help_options Undocumented
Class Variable sep_by Undocumented
Class Variable user_options Undocumented
Instance Variable build_lib Undocumented
Instance Variable build_temp Undocumented
Instance Variable compiler Undocumented
Instance Variable debug Undocumented
Instance Variable define Undocumented
Instance Variable extensions Undocumented
Instance Variable force Undocumented
Instance Variable include_dirs Undocumented
Instance Variable inplace Undocumented
Instance Variable libraries Undocumented
Instance Variable library_dirs Undocumented
Instance Variable link_objects Undocumented
Instance Variable package Undocumented
Instance Variable parallel Undocumented
Instance Variable plat_name Undocumented
Instance Variable rpath Undocumented
Instance Variable swig Undocumented
Instance Variable swig_cpp Undocumented
Instance Variable swig_opts Undocumented
Instance Variable undef Undocumented
Instance Variable user Undocumented
Method _build_extensions_parallel Undocumented
Method _build_extensions_serial Undocumented
Method _filter_build_errors Undocumented
Instance Variable _built_objects Undocumented

Inherited from Command:

Method __getattr__ Undocumented
Method __init__ Create and initialize a new Command object. Most importantly, invokes the 'initialize_options()' method, which is the real initializer and depends on the actual command being instantiated.
Method announce Undocumented
Method copy_file Copy a file respecting verbose, dry-run and force flags. (The former two default to whatever is in the Distribution object, and the latter defaults to false for commands that don't define it.)
Method copy_tree Copy an entire directory tree respecting verbose, dry-run, and force flags.
Method debug_print Print 'msg' to stdout if the global DEBUG (taken from the DISTUTILS_DEBUG environment variable) flag is true.
Method dump_options Undocumented
Method ensure_dirname Undocumented
Method ensure_filename Ensure that 'option' is the name of an existing file.
Method ensure_finalized Undocumented
Method ensure_string Ensure that 'option' is a string; if not defined, set it to 'default'.
Method ensure_string_list Ensure that 'option' is a list of strings. If 'option' is currently a string, we split it either on /,\s*/ or /\s+/, so "foo bar baz", "foo,bar,baz", and "foo, bar baz" all become ["foo", "bar", "baz"].
Method execute Undocumented
Method get_command_name Undocumented
Method get_finalized_command Wrapper around Distribution's 'get_command_obj()' method: find (create if necessary and 'create' is true) the command object for 'command', call its 'ensure_finalized()' method, and return the finalized command object.
Method get_sub_commands Determine the sub-commands that are relevant in the current distribution (ie., that need to be run). This is based on the 'sub_commands' class attribute: each tuple in that list may include a method that we call to determine if the subcommand needs to be run for the current distribution...
Method make_archive Undocumented
Method make_file Special case of 'execute()' for operations that process one or more input files and generate one output file. Works just like 'execute()', except the operation is skipped and a different message printed if 'outfile' already exists and is newer than all files listed in 'infiles'...
Method mkpath Undocumented
Method move_file Move a file respecting dry-run flag.
Method reinitialize_command Undocumented
Method run_command Run some other command: uses the 'run_command()' method of Distribution, which creates and finalizes the command object if necessary and then invokes its 'run()' method.
Method set_undefined_options Set the values of any "undefined" options from corresponding option values in some other command object. "Undefined" here means "is None", which is the convention used to indicate that an option has not been changed between 'initialize_options()' and 'finalize_options()'...
Method spawn Spawn an external command respecting dry-run flag.
Method warn Undocumented
Class Variable sub_commands Undocumented
Instance Variable distribution Undocumented
Instance Variable finalized Undocumented
Instance Variable help Undocumented
Instance Variable verbose Undocumented
Method _ensure_stringlike Undocumented
Method _ensure_tested_string Undocumented
Instance Variable _dry_run Undocumented
def build_extension(self, ext): (source)

Undocumented

def build_extensions(self): (source)

Undocumented

def check_extensions_list(self, extensions): (source)

Ensure that the list of extensions (presumably provided as a command option 'extensions') is valid, i.e. it is a list of Extension objects. We also support the old-style list of 2-tuples, where the tuples are (ext_name, build_info), which are converted to Extension instances here. Raise DistutilsSetupError if the structure is invalid anywhere; just returns otherwise.

def finalize_options(self): (source)

Set final values for all the options that this command supports. This is always called as late as possible, ie. after any option assignments from the command-line or from other commands have been done. Thus, this is the place to code option dependencies: if 'foo' depends on 'bar', then it is safe to set 'foo' from 'bar' as long as 'foo' still has the same value it was assigned in 'initialize_options()'. This method must be implemented by all command classes.

def find_swig(self): (source)

Return the name of the SWIG executable. On Unix, this is just "swig" -- it should be in the PATH. Tries a bit harder on Windows.

def get_export_symbols(self, ext): (source)

Return the list of symbols that a shared extension has to export. This either uses 'ext.export_symbols' or, if it's not provided, "PyInit_" + module_name. Only relevant on Windows, where the .pyd file (DLL) must export the module "PyInit_" function.

def get_ext_filename(self, ext_name): (source)

Convert the name of an extension (eg. "foo.bar") into the name of the file from which it will be loaded (eg. "foo/bar.so", or "foo\bar.pyd").

def get_ext_fullname(self, ext_name): (source)

Returns the fullname of a given extension name. Adds the `package.` prefix

def get_ext_fullpath(self, ext_name): (source)

Returns the path of the filename for a given extension. The file is located in `build_lib` or directly in the package (inplace option).

def get_libraries(self, ext): (source)

Return the list of libraries to link against when building a shared extension. On most platforms, this is just 'ext.libraries'; on Windows, we add the Python library (eg. python20.dll).

def get_outputs(self): (source)

Undocumented

def get_source_files(self): (source)

Undocumented

def initialize_options(self): (source)

Set default values for all the options that this command supports. Note that these defaults may be overridden by other commands, by the setup script, by config files, or by the command-line. Thus, this is not the place to code dependencies between options; generally, 'initialize_options()' implementations are just a bunch of "self.foo = None" assignments. This method must be implemented by all command classes.

def run(self): (source)

A command's raison d'etre: carry out the action it exists to perform, controlled by the options initialized in 'initialize_options()', customized by other commands, the setup script, the command-line, and config files, and finalized in 'finalize_options()'. All terminal output and filesystem interaction should be done by 'run()'. This method must be implemented by all command classes.

def swig_sources(self, sources, extension): (source)

Walk the list of source files in 'sources', looking for SWIG interface (.i) files. Run SWIG on all that are found, and return a modified 'sources' list with SWIG source files replaced by the generated C (or C++) files.

boolean_options: list[str] = (source)

Undocumented

description: str = (source)

Undocumented

help_options = (source)

Undocumented

Undocumented

user_options = (source)

Undocumented

build_lib = (source)

Undocumented

build_temp = (source)

Undocumented

compiler = (source)

Undocumented

Undocumented

Undocumented

extensions = (source)

Undocumented

include_dirs = (source)

Undocumented

Undocumented

libraries: list = (source)

Undocumented

library_dirs: list = (source)

Undocumented

link_objects = (source)

Undocumented

Undocumented

parallel = (source)

Undocumented

plat_name = (source)

Undocumented

Undocumented

Undocumented

swig_cpp = (source)

Undocumented

swig_opts: list = (source)

Undocumented

Undocumented

Undocumented

def _build_extensions_parallel(self): (source)

Undocumented

def _build_extensions_serial(self): (source)

Undocumented

@contextlib.contextmanager
def _filter_build_errors(self, ext): (source)

Undocumented

_built_objects = (source)

Undocumented