Skip to main content

controlgraph

PyPI version Build status

controlgraph is a directed graph which can be traversed to enable parallelized Debian package builds.

From the available directories with valid Debian packaging, a graph with directories (representing source packages) for nodes and build dependencies for edges is produced. The reverse of this graph can traversed with a breadth-first search to build in dependency order.

controlgraph is a program which returns the controlgraph for a directory to build, in linear or dot format.

Installation

pip3 install controlgraph

Library Usage

import sys

from pathlib import Path

import controlgraph
import networkx as nx

# get all directories
dirs = [p for p in Path.cwd().iterdir() if p.is_dir()]

# get map of local binary packages to locally-available source build dependencies
pkgs = controlgraph.parse_all_controlfiles(dirs)

# generate build dependency graph from map
dep_graph = controlgraph.graph(pkgs)

# print full dot graph
nx.nx_pydot.write_dot(dep_graph, sys.stdout)

# print linear order from depth-first search
print(" ".join(list(nx.dfs_postorder_nodes(dep_graph))))

Output

strict digraph  {
"opx-nas-daemon";
"opx-common-utils";
"opx-cps";
"opx-logging";
"opx-nas-acl";
"opx-sdi-sys";
"opx-nas-daemon" -> "opx-common-utils";
"opx-nas-daemon" -> "opx-cps";
"opx-nas-daemon" -> "opx-logging";
"opx-nas-daemon" -> "opx-nas-acl";
"opx-common-utils" -> "opx-logging";
"opx-cps" -> "opx-common-utils";
"opx-cps" -> "opx-logging";
"opx-nas-acl" -> "opx-common-utils";
"opx-nas-acl" -> "opx-cps";
"opx-nas-acl" -> "opx-logging";
"opx-sdi-sys" -> "opx-common-utils";
"opx-sdi-sys" -> "opx-logging";
}

opx-logging opx-common-utils opx-cps opx-nas-acl opx-nas-daemon opx-sdi-sys

CLI Usage

With one or more directories present, run controlgraph.

$ for r in opx-nas-acl opx-nas-daemon opx-alarm opx-logging opx-common-utils; do
    git clone "https://github.com/open-switch/$r"
  done

$ controlgraph
opx-alarm opx-logging opx-common-utils opx-nas-acl opx-nas-daemon

$ controlgraph --graph
strict digraph  {
"opx-alarm";
"opx-nas-daemon";
"opx-common-utils";
"opx-logging";
"opx-nas-acl";
"opx-nas-daemon" -> "opx-common-utils";
"opx-nas-daemon" -> "opx-logging";
"opx-nas-daemon" -> "opx-nas-acl";
"opx-common-utils" -> "opx-logging";
"opx-nas-acl" -> "opx-common-utils";
"opx-nas-acl" -> "opx-logging";
}

Metadata

Release files for controlgraph 0.7.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for controlgraph 0.7.1
File Size Uploaded Provenance Actions
controlgraph-0.7.1.tar.gz 4.3 kB Without provenance Details for controlgraph-0.7.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for controlgraph 0.7.1
File Interpreter ABI Platform Actions
controlgraph-0.7.1-py3-none-any.whl Python 3 none any Details for controlgraph-0.7.1-py3-none-any.whl

Total release size: 13.3 kB

Release files / controlgraph-0.7.1.tar.gz

Download URL controlgraph-0.7.1.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
bcf4e9f2a55f8cc08a38b6805cef63269da6630c821bdc1ca44c167a9aeff100
BLAKE2b-256 checksum
How to use checksums
2079c8bee133b097f48ad1d90e18bb72adb948106e23d8f72538ab748248b0bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.19.1

Release files / controlgraph-0.7.1-py3-none-any.whl

Download URL controlgraph-0.7.1-py3-none-any.whl
Size 9.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a1bc6b587321b93d6170cfeeedfbb2ab02d877287b77754b4c292d47454cb3b6
BLAKE2b-256 checksum
How to use checksums
d1b11396cfdc5c331cb2d95abca5caf0bca827e924090693409bb76e92bf4eb0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.19.1

Security for controlgraph 0.7.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page