get_package_info

astropy_helpers.setup_helpers.get_package_info(srcdir='.', exclude=())

Collates all of the information for building all subpackages and returns a dictionary of keyword arguments that can be passed directly to distutils.setup.

The purpose of this function is to allow subpackages to update the arguments to the package’s setup() function in its setup.py script, rather than having to specify all extensions/package data directly in the setup.py. See Astropy’s own setup.py for example usage and the Astropy development docs for more details.

This function obtains that information by iterating through all packages in srcdir and locating a setup_package.py module. This module can contain the following functions: get_extensions(), get_package_data(), get_build_options(), and get_external_libraries().

Each of those functions take no arguments.

  • get_extensions returns a list of distutils.extension.Extension objects.
  • get_package_data() returns a dict formatted as required by the package_data argument to setup().
  • get_build_options() returns a list of tuples describing the extra build options to add.
  • get_external_libraries() returns a list of libraries that can optionally be built using external dependencies.
  • get_entry_points() returns a dict formatted as required by the entry_points argument to setup().