Configuration

class lsst.sconsUtils.dependencies.Configuration(cfgFile, headers=(), libs=None, hasSwigFiles=True, includeFileDirs=['include'], libFileDirs=['lib'], hasDoxygenInclude=False, hasDoxygenTag=True, eupsProduct=None)

Bases: object

Base class for defining how to configure an LSST sconsUtils package.

Aliased as lsst.sconsUtils.Configuration.

An ups/*.cfg file should contain an instance of this class called “config”. Most LSST packages will be able to use this class directly instead of subclassing it.

The only important method is configure(), which modifies an SCons environment to use the package. If a subclass overrides configure, it may not need to call the base class __init__(), whose only purpose is to define a number of instance variables used by configure().

Parameters:
cfgFilestr

The name of the calling .cfg file, usually just passed in with the special variable __file__. This will be parsed to extract the package name and root.

headerslist of str, optional

A list of headers provided by the package, to be used in autoconf-style tests.

libslist or dict, optional

A list or dictionary of libraries provided by the package. If a dictionary is provided, libs["main"] should contain a list of regular libraries provided by the library. Other keys are “python” and “test”, which refer to libraries that are only linked against compiled Python modules and unit tests, respectively. If a list is provided, the list is used as “main”. These are used both for autoconf-style tests and to support env.getLibs(...), which recursively computes the libraries a package must be linked with.

hasSwigFilesbool, optional

If True, the package provides SWIG interface files in <root>/python.

hasDoxygenIncludebool, optional

If True, the package provides a Doxygen include file with the name <root>/doc/<name>.inc.

hasDoxygenTagbool, optional

If True, the package generates a Doxygen TAG file.

includeFileDirslist, optional

List of directories that should be searched for include files.

libFileDirslist, optional

List of directories that should be searched for libraries.

eupsProductstr

Name of the EUPS product for the package, if different from the name of the .cfg file.

Methods Summary

addCustomTests(tests)

Add custom SCons configuration tests to the Configure Context passed to the configure() method.

configure(conf, packages[, check, build])

Update an SCons environment to make use of the package.

getEupsData(eupsProduct)

Get EUPS version and product directory for named product.

parseFilename(cfgFile)

Parse the name of a .cfg file and return package name and root.

Methods Documentation

addCustomTests(tests)

Add custom SCons configuration tests to the Configure Context passed to the configure() method.

This needs to be done up-front so we can pass in a dictionary of custom tests when calling env.Configure(), and use the same configure context for all packages.

Parameters:
testsdict

A dictionary to add custom tests to. This will be passed as the custom_tests argument to env.Configure().

configure(conf, packages, check=False, build=True)

Update an SCons environment to make use of the package.

Parameters:
confSCons.Configure

An SCons Configure context. The SCons Environment conf.env should be updated by the configure function.

packagesdict

A dictionary containing the configuration modules of all dependencies (or None if the dependency was optional and was not found). The <module>.config.configure(...) method will have already been called on all dependencies.

checkbool, optional

If True, perform autoconf-style tests to verify that key components are in fact in place.

buildbool, optional

If True, this is the package currently being built, and packages in “buildRequired” and “buildOptional” dependencies will also be present in the packages dict.

static getEupsData(eupsProduct)

Get EUPS version and product directory for named product.

Parameters:
eupsProductstr

EUPS product name.

Returns:
versionstr

EUPS product version.

productDirstr

EUPS product root directory.

static parseFilename(cfgFile)

Parse the name of a .cfg file and return package name and root.

Parameters:
cfgFilestr

Name of a .cfg file.

Returns:
namestr

Package name

rootstr

Root directory.