module documentation

Undocumented

Class LibraryInfo Object containing build information about a library.
Class VariableSet Container object for the variables defined in a config file.
Exception FormatError Exception thrown when there is a problem parsing a configuration file.
Exception PkgNotFound Exception raised when a package can not be located.
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.
Function _escape_backslash Undocumented
Function _read_config_imp Undocumented
Constant _CACHE Undocumented
Constant _VAR Undocumented
def parse_config(filename, dirs=None): (source)

Undocumented

def parse_flags(line): (source)

Parse a line from a config file containing compile flags.

Parameters
line:strA single line containing one or more compile flags.
Returns
dict

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

Undocumented

def parse_sections(config): (source)

Undocumented

def parse_variables(config): (source)

Undocumented

def pkg_to_filename(pkg_name): (source)

Undocumented

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

Return library info for a package from its configuration file.

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
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 directories - usually including the NumPy base directory - where to look for npy-pkg-config files.
Returns
class instancepkginfo - The LibraryInfo instance containing the build information.
Raises
PkgNotFoundIf the package is not found.
def _escape_backslash(val): (source)

Undocumented

def _read_config_imp(filenames, dirs=None): (source)

Undocumented

Undocumented

Value
{}

Undocumented

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