Skip to content
Snippets Groups Projects
Commit 178adb72 authored by André Anjos's avatar André Anjos :speech_balloon:
Browse files

[graph] Improve cli and documentation

parent eaf89934
Branches
Tags
1 merge request!126Implemented a mechanism to run a dependency graph
Pipeline #35404 failed
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Utilities for calculating package dependencies and drawing graphs"""
import os
import re
import glob
......@@ -179,8 +181,11 @@ def compute_adjencence_matrix(
elif p.startswith("batl"):
return "/".join(("batl", p))
else:
logger.warning("Do not know how to recurse to package %s "
"(to which group does it belong?) - skipping...", p)
logger.warning(
"Do not know how to recurse to package %s "
"(to which group does it belong?) - skipping...",
p,
)
return None
all_recurse = set([_add_default_group(k) for k in all_recurse])
......@@ -189,8 +194,9 @@ def compute_adjencence_matrix(
# do not recurse for packages we already know
all_recurse -= set(current.keys())
logger.info("Recursing over the following packages: %s",
", ".join(all_recurse))
logger.info(
"Recursing over the following packages: %s", ", ".join(all_recurse)
)
for dep in all_recurse:
dep_adjmtx = compute_adjencence_matrix(
......
......@@ -28,12 +28,18 @@ logger = get_logger(__name__)
epilog="""
Examples:
1. Draws the graph of a package
1. Calculates and draws the graph of a package:
$ bdt gitlab graph -vv bob/bob.learn.linear
$ bdt gitlab graph bob/bob.blitz
2.
2. Calculates and draws only the runtime dependencies of a package
$ bdt gitlab graph bob/bob.blitz --deptypes=run
3. Calculates run and test dependencies of package, but only draws a subset
defined by a regular expression
$ bdt gitlab graph beat/beat.editor --deptypes=run --deptypes=test --whitelist='^beat\.(editor|cmdline).*$'
"""
)
......
......@@ -106,6 +106,7 @@ test:
- bdt gitlab process-pipelines --help
- bdt gitlab get-pipelines --help
- bdt gitlab graph --help
- bdt gitlab graph -vv bob/bob.blitz -d run
- sphinx-build -aEW ${PREFIX}/share/doc/{{ name }}/doc sphinx
- if [ -n "${CI_PROJECT_DIR}" ]; then mv sphinx "${CI_PROJECT_DIR}/"; fi
......
......@@ -14,6 +14,8 @@
bob.devtools.bootstrap
bob.devtools.build
bob.devtools.mirror
bob.devtools.deploy
bob.devtools.graph
bob.devtools.webdav3.client
......@@ -34,8 +36,12 @@ Detailed Information
.. automodule:: bob.devtools.build
.. automodule:: bob.devtools.mirror
.. automodule:: bob.devtools.deploy
.. automodule:: bob.devtools.graph
WebDAV Python Client
--------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment