Skip to content

PyUtils: add Python package dependencies to `acmd cmake depends`

Frank Winklmeier requested to merge fwinkl/athena:py_depends into master

acmd.py cmake depends is able to show link dependencies between packages (see this talk). This MR adds the ability to also show Python dependencies between packages:

  1. A new script apydep.py has been added that can be run on a source directory and will print/store the Python dependencies between packages as DOT graph. This is analogous to the cmake --graphviz output. Both include and import dependencies are considered. The script parses all Python files in the given source tree and based on the Abstract Syntax Tree (AST) derives the packages dependencies. In release building mode, the resulting packages.py.dot file is installed into ${AtlasArea}/InstallArea/${BINARY_TAG} alongside the already existing packages.dot (for the Athena project the file is ~400kB large and takes ~30s to generate).
  2. A new command line option (--py) has been added to acmd.py cmake depends to show the Python dependencies for a given package.

Since a picture is worth a thousand words... (requires also !39006 (merged))

acmd.py cmake depends --py --dot --legend --clients TriggerD3PDMaker | dot -Tsvg -O

TriggerD3PDMaker.svg

Edited by Frank Winklmeier

Merge request reports

Loading