build_helpers.py script¶
Build helpers for setup.py.
Includes package dependency checks and monkey-patch to numpy.distutils to work with Cython.
Notes¶
The original version of this file was adapted from NiPy project [1].
[1] http://nipy.sourceforge.net/
-
class
build_helpers.
Clean
(dist)[source]¶ Distutils Command class to clean, enhanced to clean also files generated during python setup.py build_ext –inplace.
-
class
build_helpers.
NoOptionsDocs
(dist)[source]¶ -
-
user_options
= [('None', None, 'this command has no options')]¶
-
-
build_helpers.
generate_a_pyrex_source
(self, base, ext_name, source, extension)[source]¶ Monkey patch for numpy build_src.build_src method
Uses Cython instead of Pyrex.
-
build_helpers.
package_check
(pkg_name, version=None, optional=False, checker=<class distutils.version.LooseVersion>, version_getter=None, messages=None, show_only=False)[source]¶ Check if package pkg_name is present, and in correct version.
Parameters: pkg_name : str or sequence of str
The name of the package as imported into python. Alternative names (e.g. for different versions) may be given in a list.
version : str, optional
The minimum version of the package that is required. If not given, the version is not checked.
optional : bool, optional
If False, raise error for absent package or wrong version; otherwise warn
checker : callable, optional
If given, the callable with which to return a comparable thing from a version string. The default is
distutils.version.LooseVersion
.version_getter : callable, optional:
If given, the callable that takes pkg_name as argument, and returns the package version string - as in:
``version = version_getter(pkg_name)``
The default is equivalent to:
mod = __import__(pkg_name); version = mod.__version__``
messages : dict, optional
If given, the dictionary providing (some of) output messages.
show_only : bool
If True, do not raise exceptions, only show the package name and version information.