rlsbl v0.40.1 /rlsbl.workspace_graph
On this page

Dependency graph builder for monorepo workspaces that parses project manifests and provides topological sorting for ordered operations.

#rlsbl.workspace_graph

#rlsbl.workspace_graph

Dependency graph builder for monorepo workspaces that parses project manifests and provides topological sorting for ordered operations.

#WorkspaceScanner

Protocol for pluggable workspace dependency scanners.

#scan

python
def scan(self, project_dir: str, workspace_names: set[str]) -> list[Dependency]

Scan a project directory for intra-workspace dependencies.

project_dir: absolute path to the project directory. workspace_names: set of all workspace project names (raw, unnormalized). Returns a list of Dependency namedtuples for deps found within the workspace.

#CycleError

Raised when the workspace dependency graph contains a cycle.

#_parse_pypi_dep_name

python
def _parse_pypi_dep_name(dep_string)

Extract the package name from a PEP 508 dependency string.

Handles forms like: - "requests>=2.0" - "my-lib[extra]>=1.0" - "foo @ file:///path/to/foo" - "foo @ {root:uri}/path" Returns (name, is_path_dep, constraint) where constraint is the version specifier string or the full @ URI for path deps.

#PypiScanner

Scan pyproject.toml for intra-workspace PyPI dependencies.

#scan

python
def scan(self, project_dir: str, workspace_names: set[str]) -> list[Dependency]

#NpmScanner

Scan package.json for intra-workspace npm dependencies.

#scan

python
def scan(self, project_dir: str, workspace_names: set[str]) -> list[Dependency]

#DartScanner

Scan pubspec.yaml for intra-workspace Dart/Flutter dependencies.

#scan

python
def scan(self, project_dir: str, workspace_names: set[str]) -> list[Dependency]

#WorkspaceGraph

Directed dependency graph of intra-workspace project dependencies.

#dependencies

python
def dependencies(self, project_name)

Return list of Dependency namedtuples for intra-workspace deps.

#dependents

python
def dependents(self, project_name)

Return list of project names that depend on this project.

#topological_order

python
def topological_order(self)

Return project names in topological order (leaves first).

Raises CycleError if the graph contains cycles.

#has_cycles

python
def has_cycles(self)

Return True if the dependency graph contains cycles.

#transitive_deps

python
def transitive_deps(self, name, depth=None)

Return transitive dependency names in BFS discovery order.

Excludes the starting node. Optional depth limits traversal (None = unlimited, 0 = empty list). Raises KeyError if name is not in the graph.

#transitive_rdeps

python
def transitive_rdeps(self, name, depth=None)

Return transitive reverse-dependency names in BFS discovery order.

Excludes the starting node. Optional depth limits traversal (None = unlimited, 0 = empty list). Raises KeyError if name is not in the graph.

#dep_count

python
def dep_count(self, project_name)

Return number of intra-workspace dependencies for a project.

#rdep_count

python
def rdep_count(self, project_name)

Return number of projects that depend on this project.