module documentation

Undocumented

Class ​Configuration No class docstring; 0/11 instance variable, 0/4 class variable, 30/38 methods documented
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 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 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 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​_num​_build​_jobs No summary
Function get​_numpy​_include​_dirs Undocumented
Function get​_pkg​_info Return library info for the given package.
Function get​_script​_files Undocumented
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​_local​_src​_dir Return true if directory is local directory.
Function is​_sequence Undocumented
Function is​_string Undocumented
Function mingw32 Return true when using mingw32 environment.
Function minrelpath Resolve .. and '.' from path.
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 red​_text Undocumented
Function sanitize​_cxx​_flags Some flags are valid for C but not C++. Prune them.
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
Class ​Installable​Lib Container to hold information on an installable library.
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
Function clean​_up​_temporary​_directory Undocumented
Function colour​_text Undocumented
Function default​_text Undocumented
Function general​_source​_directories​_files Return a directory name relative to top_path and files contained.
Function general​_source​_files Undocumented
Function get​_npy​_pkg​_dir Return the path where to find the npy-pkg-config directory.
Function get​_path​_from​_frame Return path of the module given a frame object from the call stack.
Function get​_shared​_lib​_extension Return the correct file extension for shared libraries.
Function is​_bootstrapping Undocumented
Function is​_glob​_pattern Undocumented
Function make​_temp​_file Undocumented
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 quote​_args Quote list of arguments.
Function rel​_path Return path relative to parent_path.
Function sorted​_glob sorts output of python glob for https://bugs.python.org/issue30461 to allow extensions to have reproducible build results
Variable ​_colour​_codes Undocumented
Variable ​_cxx​_ignore​_flags Undocumented
Variable ​_tdata Undocumented
Variable ​_tmpdirs Undocumented
def all_strings(lst):
Return True if all items in lst are string objects.
def allpath(name):
Convert a /-separated pathname to one using the OS's path separator.
def appendpath(prefix, path):

Undocumented

def as_list(seq):

Undocumented

def blue_text(s):

Undocumented

def cyan_text(s):

Undocumented

def cyg2win32(path):

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

Parameters

path : str
The path to convert

Returns

converted_path : str
The converted path

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:strUndocumented
Returns
strUndocumented
def default_config_dict(name=None, parent_name=None, local_path=None):
Return a configuration dictionary for usage in configuration() function defined in file setup_<name>.py.
def dict_append(d, **kws):

Undocumented

def dot_join(*args):

Undocumented

def exec_mod_from_location(modname, modfile):
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):
Return four lists of filenames containing C, C++, Fortran, and Fortran 90 module sources, respectively.
def generate_config_py(target):

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():

Undocumented

def get_cmd(cmdname, _cache={}):

Undocumented

def get_data_files(data):

Undocumented

def get_dependencies(sources):

Undocumented

def get_ext_source_files(ext):

Undocumented

def get_frame(level=0):
Return frame object from call stack with given level.
def get_info(pkgname, dirs=None):

Return an info dict for a given C library.

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

Parameters

pkgname : str
Name of the package (should match the name of the .ini file, without the extension, e.g. foo for the file foo.ini).
dirs : sequence, optional
If 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

info : dict
The dictionary with build information.

Raises

PkgNotFound
If the package is not found.

See Also

Configuration.add_npy_pkg_config, Configuration.add_installed_library, get_pkg_info

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)
def get_language(sources):
Determine language value (c,f77,f90) from sources
def get_lib_source_files(lib):

Undocumented

def get_mathlibs(path=None):
Return the MATHLIB line from numpyconfig.h
def 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).

Returns

out : int
number of parallel jobs that can be run
def get_numpy_include_dirs():

Undocumented

def get_pkg_info(pkgname, dirs=None):

Return library info for the given package.

Parameters

pkgname : str
Name of the package (should match the name of the .ini file, without the extension, e.g. foo for the file foo.ini).
dirs : sequence, optional
If 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

pkginfo : class instance
The LibraryInfo instance containing the build information.

Raises

PkgNotFound
If the package is not found.

See Also

Configuration.add_npy_pkg_config, Configuration.add_installed_library, get_info

def get_script_files(scripts):

Undocumented

def gpaths(paths, local_path='', include_non_existing=True):
Apply glob to paths and prepend local_path if needed.
def green_text(s):

Undocumented

def has_cxx_sources(sources):
Return True if sources contains C++ files
def has_f_sources(sources):
Return True if sources contains Fortran files
def is_local_src_dir(directory):
Return true if directory is local directory.
def is_sequence(seq):

Undocumented

def is_string(s):

Undocumented

def mingw32():
Return true when using mingw32 environment.
def minrelpath(path):
Resolve .. and '.' from path.
def njoin(*path):

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 red_text(s):

Undocumented

def sanitize_cxx_flags(cxxflags):
Some flags are valid for C but not C++. Prune them.
def terminal_has_colors():

Undocumented

def yellow_text(s):

Undocumented

cxx_ext_match =

Undocumented

f90_ext_match =

Undocumented

f90_module_name_match =

Undocumented

fortran_ext_match =

Undocumented

def _commandline_dep_string(cc_args, extra_postargs, pp_opts):
Return commandline representation used to determine if a file needs to be recompiled
def _fix_paths(paths, local_path, include_non_existing):

Undocumented

def _get_directories(list_of_sources):

Undocumented

def _get_f90_modules(source):
Return a list of Fortran f90 module names that given source file defines.
def _get_headers(directory_list):

Undocumented

def clean_up_temporary_directory():

Undocumented

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

Undocumented

def default_text(s):

Undocumented

def general_source_directories_files(top_path):
Return a directory name relative to top_path and files contained.
def general_source_files(top_path):

Undocumented

def get_npy_pkg_dir():

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_path_from_frame(frame, parent_path=None):

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_shared_lib_extension(is_python_ext=False):

Return the correct file extension for shared libraries.

Parameters

is_python_ext : bool, optional
Whether the shared library is a Python extension. Default is False.

Returns

so_ext : str
The shared library extension.

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. For Python 3.2 this is implemented on Linux, but not on OS X.

def is_bootstrapping():

Undocumented

def is_glob_pattern(s):

Undocumented

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

Undocumented

def msvc_runtime_library():
Return name of MSVC runtime library if Python was built with MSVC >= 7
def msvc_runtime_major():
Return major version of MSVC runtime coded like get_build_msvc_version
def msvc_runtime_version():
Return version of MSVC runtime library, as defined by __MSC_VER__ macro
def msvc_version(compiler):
Return version major and minor of compiler instance if it is MSVC, raise an exception otherwise.
def quote_args(args):

Quote list of arguments.

Deprecated since version 1.22..
def rel_path(path, parent_path):
Return path relative to parent_path.
def sorted_glob(fileglob):
sorts output of python glob for https://bugs.python.org/issue30461 to allow extensions to have reproducible build results
_colour_codes =

Undocumented

_cxx_ignore_flags: set[str] =

Undocumented

_tdata =

Undocumented

_tmpdirs: list =

Undocumented