module documentation

Undocumented

Class Configuration No class docstring; 0/11 instance variable, 0/4 class variable, 30/38 methods documented
Class InstallableLib Container to hold information on an installable library.
Function all_strings Return True if all items in lst are string objects.
Function allpath Convert a /-separated pathname to one using the OS's path separator.
Function appendpath Undocumented
Function as_list Undocumented
Function blue_text Undocumented
Function clean_up_temporary_directory Undocumented
Function colour_text Undocumented
Function cyan_text Undocumented
Function cyg2win32 Convert a path from Cygwin-native to Windows-native.
Function default_config_dict Return a configuration dictionary for usage in configuration() function defined in file setup_<name>.py.
Function default_text Undocumented
Function dict_append Undocumented
Function dot_join Undocumented
Function exec_mod_from_location Use importlib machinery to import a module modname from the file modfile. Depending on the spec.loader, the module may not be registered in sys.modules.
Function filter_sources Return four lists of filenames containing C, C++, Fortran, and Fortran 90 module sources, respectively.
Function general_source_directories_files Return a directory name relative to top_path and files contained.
Function general_source_files Undocumented
Function generate_config_py Generate config.py file containing system_info information used during building the package.
Function get_build_architecture Undocumented
Function get_cmd Undocumented
Function get_data_files Undocumented
Function get_dependencies Undocumented
Function get_ext_source_files Undocumented
Function get_frame Return frame object from call stack with given level.
Function get_info Return an info dict for a given C library.
Function get_language Determine language value (c,f77,f90) from sources
Function get_lib_source_files Undocumented
Function get_mathlibs Return the MATHLIB line from numpyconfig.h
Function get_npy_pkg_dir Return the path where to find the npy-pkg-config directory.
Function get_num_build_jobs Get number of parallel build jobs set by the --parallel command line argument of setup.py If the command did not receive a setting the environment variable NPY_NUM_BUILD_JOBS is checked. If that is unset, return the number of processors on the system, with a maximum of 8 (to prevent overloading the system if there a lot of CPUs).
Function get_numpy_include_dirs Undocumented
Function get_path_from_frame Return path of the module given a frame object from the call stack.
Function get_pkg_info Return library info for the given package.
Function get_script_files Undocumented
Function get_shared_lib_extension Return the correct file extension for shared libraries.
Function gpaths Apply glob to paths and prepend local_path if needed.
Function green_text Undocumented
Function has_cxx_sources Return True if sources contains C++ files
Function has_f_sources Return True if sources contains Fortran files
Function is_bootstrapping Undocumented
Function is_glob_pattern Undocumented
Function is_local_src_dir Return true if directory is local directory.
Function is_sequence Undocumented
Function is_string Undocumented
Function make_temp_file Undocumented
Function mingw32 Return true when using mingw32 environment.
Function minrelpath Resolve .. and '.' from path.
Function msvc_runtime_library Return name of MSVC runtime library if Python was built with MSVC >= 7
Function msvc_runtime_major Return major version of MSVC runtime coded like get_build_msvc_version
Function msvc_runtime_version Return version of MSVC runtime library, as defined by __MSC_VER__ macro
Function msvc_version Return version major and minor of compiler instance if it is MSVC, raise an exception otherwise.
Function njoin Join two or more pathname components + - convert a /-separated pathname to one using the OS's path separator. - resolve .. and . from path.
Function quote_args Quote list of arguments.
Function red_text Undocumented
Function rel_path Return path relative to parent_path.
Function sanitize_cxx_flags Some flags are valid for C but not C++. Prune them.
Function sorted_glob sorts output of python glob for https://bugs.python.org/issue30461 to allow extensions to have reproducible build results
Function terminal_has_colors Undocumented
Function yellow_text Undocumented
Variable cxx_ext_match Undocumented
Variable f90_ext_match Undocumented
Variable f90_module_name_match Undocumented
Variable fortran_ext_match Undocumented
Function _commandline_dep_string Return commandline representation used to determine if a file needs to be recompiled
Function _fix_paths Undocumented
Function _get_directories Undocumented
Function _get_f90_modules Return a list of Fortran f90 module names that given source file defines.
Function _get_headers Undocumented
Variable _colour_codes Undocumented
Variable _cxx_ignore_flags Undocumented
Variable _tdata Undocumented
Variable _tmpdirs Undocumented
def all_strings(lst): (source)

Return True if all items in lst are string objects.

def allpath(name): (source)

Convert a /-separated pathname to one using the OS's path separator.

def appendpath(prefix, path): (source)

Undocumented

def as_list(seq): (source)

Undocumented

def blue_text(s): (source)

Undocumented

def clean_up_temporary_directory(): (source)

Undocumented

def colour_text(s, fg=None, bg=None, bold=False): (source)

Undocumented

def cyan_text(s): (source)

Undocumented

def cyg2win32(path: str) -> str: (source)

Convert a path from Cygwin-native to Windows-native.

Uses the cygpath utility (part of the Base install) to do the actual conversion. Falls back to returning the original path if this fails.

Handles the default /cygdrive mount prefix as well as the /proc/cygdrive portable prefix, custom cygdrive prefixes such as / or /mnt, and absolute paths such as /usr/src/ or /home/username

Notes

Documentation for cygpath utility: https://cygwin.com/cygwin-ug-net/cygpath.html Documentation for the C function it wraps: https://cygwin.com/cygwin-api/func-cygwin-conv-path.html

Parameters
path:strThe path to convert
Returns
strconverted_path - The converted path
def default_config_dict(name=None, parent_name=None, local_path=None): (source)

Return a configuration dictionary for usage in configuration() function defined in file setup_<name>.py.

def default_text(s): (source)

Undocumented

def dict_append(d, **kws): (source)

Undocumented

def dot_join(*args): (source)

Undocumented

def exec_mod_from_location(modname, modfile): (source)

Use importlib machinery to import a module modname from the file modfile. Depending on the spec.loader, the module may not be registered in sys.modules.

def filter_sources(sources): (source)

Return four lists of filenames containing C, C++, Fortran, and Fortran 90 module sources, respectively.

def general_source_directories_files(top_path): (source)

Return a directory name relative to top_path and files contained.

def general_source_files(top_path): (source)

Undocumented

def generate_config_py(target): (source)

Generate config.py file containing system_info information used during building the package.

Usage:
config['py_modules'].append((packagename, '__config__',generate_config_py))
def get_build_architecture(): (source)

Undocumented

def get_cmd(cmdname, _cache={}): (source)

Undocumented

def get_data_files(data): (source)

Undocumented

def get_dependencies(sources): (source)

Undocumented

def get_ext_source_files(ext): (source)

Undocumented

def get_frame(level=0): (source)

Return frame object from call stack with given level.

def get_info(pkgname, dirs=None): (source)

Return an info dict for a given C library.

The info dict contains the necessary options to use the C library.

Examples

To get the necessary information for the npymath library from NumPy:

>>> npymath_info = np.distutils.misc_util.get_info('npymath')
>>> npymath_info                                    #doctest: +SKIP
{'define_macros': [], 'libraries': ['npymath'], 'library_dirs':
['.../numpy/core/lib'], 'include_dirs': ['.../numpy/core/include']}

This info dict can then be used as input to a Configuration instance:

config.add_extension('foo', sources=['foo.c'], extra_info=npymath_info)
Parameters
pkgname:strName of the package (should match the name of the .ini file, without the extension, e.g. foo for the file foo.ini).
dirs:sequence, optionalIf given, should be a sequence of additional directories where to look for npy-pkg-config files. Those directories are searched prior to the NumPy directory.
Returns
dictinfo - The dictionary with build information.
Raises
PkgNotFoundIf the package is not found.
def get_language(sources): (source)

Determine language value (c,f77,f90) from sources

def get_lib_source_files(lib): (source)

Undocumented

def get_mathlibs(path=None): (source)

Return the MATHLIB line from numpyconfig.h

def get_npy_pkg_dir(): (source)

Return the path where to find the npy-pkg-config directory.

If the NPY_PKG_CONFIG_PATH environment variable is set, the value of that is returned. Otherwise, a path inside the location of the numpy module is returned.

The NPY_PKG_CONFIG_PATH can be useful when cross-compiling, maintaining customized npy-pkg-config .ini files for the cross-compilation environment, and using them when cross-compiling.

def get_num_build_jobs(): (source)

Get number of parallel build jobs set by the --parallel command line argument of setup.py If the command did not receive a setting the environment variable NPY_NUM_BUILD_JOBS is checked. If that is unset, return the number of processors on the system, with a maximum of 8 (to prevent overloading the system if there a lot of CPUs).

Returns
intout - number of parallel jobs that can be run
def get_numpy_include_dirs(): (source)

Undocumented

def get_path_from_frame(frame, parent_path=None): (source)

Return path of the module given a frame object from the call stack.

Returned path is relative to parent_path when given, otherwise it is absolute path.

def get_pkg_info(pkgname, dirs=None): (source)

Return library info for the given package.

Parameters
pkgname:strName of the package (should match the name of the .ini file, without the extension, e.g. foo for the file foo.ini).
dirs:sequence, optionalIf given, should be a sequence of additional directories where to look for npy-pkg-config files. Those directories are searched prior to the NumPy directory.
Returns
class instancepkginfo - The LibraryInfo instance containing the build information.
Raises
PkgNotFoundIf the package is not found.
def get_script_files(scripts): (source)

Undocumented

def get_shared_lib_extension(is_python_ext=False): (source)

Return the correct file extension for shared libraries.

Notes

For Python shared libs, so_ext will typically be '.so' on Linux and OS X, and '.pyd' on Windows. For Python >= 3.2 so_ext has a tag prepended on POSIX systems according to PEP 3149.

Parameters
is_python_ext:bool, optionalWhether the shared library is a Python extension. Default is False.
Returns
strso_ext - The shared library extension.
def gpaths(paths, local_path='', include_non_existing=True): (source)

Apply glob to paths and prepend local_path if needed.

def green_text(s): (source)

Undocumented

def has_cxx_sources(sources): (source)

Return True if sources contains C++ files

def has_f_sources(sources): (source)

Return True if sources contains Fortran files

def is_bootstrapping(): (source)

Undocumented

def is_glob_pattern(s): (source)

Undocumented

def is_local_src_dir(directory): (source)

Return true if directory is local directory.

def is_sequence(seq): (source)

Undocumented

def is_string(s): (source)

Undocumented

def make_temp_file(suffix='', prefix='', text=True): (source)

Undocumented

def mingw32(): (source)

Return true when using mingw32 environment.

def minrelpath(path): (source)

Resolve .. and '.' from path.

def msvc_runtime_library(): (source)

Return name of MSVC runtime library if Python was built with MSVC >= 7

def msvc_runtime_major(): (source)

Return major version of MSVC runtime coded like get_build_msvc_version

def msvc_runtime_version(): (source)

Return version of MSVC runtime library, as defined by __MSC_VER__ macro

def msvc_version(compiler): (source)

Return version major and minor of compiler instance if it is MSVC, raise an exception otherwise.

def njoin(*path): (source)

Join two or more pathname components + - convert a /-separated pathname to one using the OS's path separator. - resolve .. and . from path.

Either passing n arguments as in njoin('a','b'), or a sequence of n names as in njoin(['a','b']) is handled, or a mixture of such arguments.

def quote_args(args): (source)

Quote list of arguments.

Deprecated since version 1.22..
def red_text(s): (source)

Undocumented

def rel_path(path, parent_path): (source)

Return path relative to parent_path.

def sanitize_cxx_flags(cxxflags): (source)

Some flags are valid for C but not C++. Prune them.

def sorted_glob(fileglob): (source)

sorts output of python glob for https://bugs.python.org/issue30461 to allow extensions to have reproducible build results

def terminal_has_colors(): (source)

Undocumented

def yellow_text(s): (source)

Undocumented

cxx_ext_match = (source)

Undocumented

f90_ext_match = (source)

Undocumented

f90_module_name_match = (source)

Undocumented

fortran_ext_match = (source)

Undocumented

def _commandline_dep_string(cc_args, extra_postargs, pp_opts): (source)

Return commandline representation used to determine if a file needs to be recompiled

def _fix_paths(paths, local_path, include_non_existing): (source)

Undocumented

def _get_directories(list_of_sources): (source)

Undocumented

def _get_f90_modules(source): (source)

Return a list of Fortran f90 module names that given source file defines.

def _get_headers(directory_list): (source)

Undocumented

_colour_codes = (source)

Undocumented

_cxx_ignore_flags: set[str] = (source)

Undocumented

Undocumented

_tmpdirs: list = (source)

Undocumented