module documentation

Undocumented

Class ​Format​Error Exception thrown when there is a problem parsing a configuration file.
Class ​Library​Info Object containing build information about a library.
Class ​Pkg​Not​Found Exception raised when a package can not be located.
Class ​Variable​Set Container object for the variables defined in a config file.
Function ​_escape​_backslash Undocumented
Function ​_read​_config​_imp Undocumented
Function parse​_config Undocumented
Function parse​_flags Parse a line from a config file containing compile flags.
Function parse​_meta Undocumented
Function parse​_sections Undocumented
Function parse​_variables Undocumented
Function pkg​_to​_filename Undocumented
Function read​_config Return library info for a package from its configuration file.
Constant ​_CACHE Undocumented
Constant ​_VAR Undocumented
def _escape_backslash(val):

Undocumented

def _read_config_imp(filenames, dirs=None):

Undocumented

def parse_config(filename, dirs=None):

Undocumented

def parse_flags(line):

Parse a line from a config file containing compile flags.

Parameters

line : str
A single line containing one or more compile flags.

Returns

d : dict

Dictionary of parsed flags, split into relevant categories. These categories are the keys of d:

  • 'include_dirs'
  • 'library_dirs'
  • 'libraries'
  • 'macros'
  • 'ignored'
def parse_meta(config):

Undocumented

def parse_sections(config):

Undocumented

def parse_variables(config):

Undocumented

def pkg_to_filename(pkg_name):

Undocumented

def read_config(pkgname, dirs=None):

Return library info for a package from its configuration file.

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 directories - usually including the NumPy base directory - where to look for npy-pkg-config files.

Returns

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

Raises

PkgNotFound
If the package is not found.

See Also

misc_util.get_info, misc_util.get_pkg_info

Examples

>>> npymath_info = np.distutils.npy_pkg_config.read_config('npymath')
>>> type(npymath_info)
<class 'numpy.distutils.npy_pkg_config.LibraryInfo'>
>>> print(npymath_info)
Name: npymath
Description: Portable, core math library implementing C99 standard
Requires:
Version: 0.1  #random
_CACHE: dict =

Undocumented

Value
{}
_VAR =

Undocumented

Value
re.compile(r'\$\{([a-zA-Z0-9_-]+)\}')