PackageTree#

class lsst.sconsUtils.dependencies.PackageTree(primaryName, noCfgFile=False)#

Bases: object

A class for loading and managing the dependency tree of a package, as defined by its configuration module (.cfg) file.

This tree isn’t actually stored as a tree; it’s flattened into an ordered dictionary as it is recursively loaded.

The main SCons produced by configure() and available as lsst.sconsUtils.env will contain an instance of this class as env.dependencies.

Its can be used like a read-only dictionary to check whether an optional package has been configured; a package that was not found will have a value of None, while a configured package’s value will be its imported .cfg module.

Parameters#

primaryNamestr

The name of the primary package being built.

noCfgFilebool, optional

If True, this package has no .cfg file

Notes#

After __init__, self.primary will be set to the configuration module for the primary package, and self.packages will be an OrderedDict of dependencies (excluding self.primary), ordered such that configuration can proceed in iteration order.

Attributes Summary

name

versions

Version of every dependency, keyed by package name (dict [str, str or None]).

Methods Summary

configure(env)

Configure the entire dependency tree in order.

get(name[, default])

has_key(name)

keys()

Attributes Documentation

name#
versions#

Version of every dependency, keyed by package name (dict [str, str or None]).

A dependency that was not found has a version of None, and one whose configuration does not record a version has "unknown". The closure of a dependency synthesized from pkg-config is included, after the dependencies loaded in their own right.

Methods Documentation

configure(env)#

Configure the entire dependency tree in order. and return an updated environment.

get(name, default=None)#
has_key(name)#
keys()#