# tools/build_helpers.py script

Build helpers for setup.py.

## Notes

The original version of this file was adapted from NiPy project [1].

[1] http://nipy.sourceforge.net/

class build_helpers.Clean(dist: Distribution, **kw)

  Command class to clean, enhanced to clean also files generated during python setup.py build_ext –inplace.

  run()

    After calling the super class implementation, this function removes the directories specific to scikit-build.

class build_helpers.DoxygenDocs(dist: Distribution, **kw)
  description = 'generate docs by Doxygen'
  run()

    Execute the actions intended by the command. (Side effects SHOULD only take place when `run()` is executed, for example, creating new files or writing to the terminal output).

class build_helpers.NoOptionsDocs(dist: Distribution, **kw)
  finalize_options()

    Set final values for all options/attributes used by the command. Most of the time, each option/attribute/cache should only be set if it does not have any value yet (e.g. `if self.attr is None: self.attr = val`).

  initialize_options()

    Set or (reset) all options/attributes/caches used by the command to their default values. Note that these values may be overwritten during the build.

  user_options: ClassVar[list[tuple[str, str, str]] | list[tuple[str, str | None, str]]] = [('None', None, 'this command has no options')]

class build_helpers.SphinxHTMLDocs(dist: Distribution, **kw)
  description = 'generate html docs by Sphinx'
  run()

    Execute the actions intended by the command. (Side effects SHOULD only take place when `run()` is executed, for example, creating new files or writing to the terminal output).

class build_helpers.SphinxPDFDocs(dist: Distribution, **kw)
  description = 'generate pdf docs by Sphinx'
  run()

    Execute the actions intended by the command. (Side effects SHOULD only take place when `run()` is executed, for example, creating new files or writing to the terminal output).

build_helpers.get_sphinx_make_command()

build_helpers.have_good_cython()

build_helpers.package_check(pkg_name, version=None, optional=False, checker=<function parse>, version_getter=None, messages=None, show_only=False)

  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 `packaging.version.parse()`.

    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.

build_helpers.recursive_glob(top_dir, pattern)

  Utility function working like glob.glob(), but working recursively and returning generator.

  Parameters:
    topdir str

      The top-level directory.

    pattern str or list of str

      The pattern or list of patterns to match.