project

Description

Project management for SysML v2 and KerML based on Sysand.

Index

Classes

ProjectError

The project (its .project.json, .meta.json or location) is missing, malformed, or does not contain what the call needs.

SysandError

Base class of every error raised by the sysand package.

Discovery

Result of sysand.discover().

Functions

discover

Find the project and the workspace enclosing path.

root

Find the root directory of the project containing path.


Functions

discover(path: str | pathlib.Path = '.') → syside.project.Discovery

Find the project and the workspace enclosing path.

This is the same lookup every CLI command performs first: walk up from path to the nearest directory holding .project.json (or .meta.json), and separately to the nearest one holding .workspace.json. Paths are canonicalized, as sysand.root() does. A tool that must not operate inside a workspace checks workspace_root before doing anything else.

Raises:
ProjectError: a directory could not be read, or .workspace.json is

malformed.

root(path: str | pathlib.Path = '.') → pathlib.Path | None

Find the root directory of the project containing path.

Args:

path: Path to start searching from. Defaults to the current directory.

Returns:

The canonicalized project root as a Path, or None if path is not inside a project.