Project command
Creates SysML v2 and KerML projects and manages the projects they use. A
project is a directory with a .project.json and .meta.json files that
describe it, give its version and list its usages, that is, other projects
it depends on. The command is based on the Sysand package manager
and writes the same files Sysand does. For now we make no compatibility
promises between projects managed by this command and Sysand.
Command |
Description |
|---|---|
Create a project |
|
Add a usage to the current project, update the lockfile and install the locked projects |
|
Resolve the current project’s usages and write them to the lockfile |
|
Install the projects in the lockfile |
add, lock and sync act on the current project: the nearest of the
current directory and its parent directories that contains .project.json.
The files the commands work with are:
File |
Contents |
|---|---|
|
The project’s name, publisher, version, license and usages |
|
When the project was created, its metamodel, and the packages its model files define |
|
Lockfile. It records the exact version, and where it comes from, of every project the current project uses, directly or through other projects |
|
Environment. Holds the installed projects recorded in the lockfile. Syside finds the libraries a project uses here |
|
The project’s configuration |
SysML v2 and KerML standard libraries are not locked or installed, because Syside provides them.
Init command
Creates a project in a directory, creating the directory if it does not exist.
syside project init [PATH] --publisher <PUBLISHER> --metamodel <KIND> --kind <KIND> [options]
[PATH]- the directory to create the project in. Defaults to the current directory
Option |
Description |
|---|---|
|
Required. The person, team or organization that develops the project. Together with the name, it identifies the project when other projects use it |
|
Required. The metamodel the project is written in: |
|
Required. The kind of project to create. |
|
The name of the project. Defaults to the name of the directory |
|
The version of the project, in Semantic Versioning 2.0 format.
Defaults to |
|
The license of the project, as an SPDX license expression such as
|
The command also takes the global options.
For example, to create a project for the Drone model in a new drone
directory:
syside project init drone --publisher "Acme Labs" --name Drone --version 0.1.0 \
--metamodel sysml --kind project-json
Add command
Adds a usage of another project to the current project’s .project.json, then
updates the lockfile and installs the locked projects into .sysand, as
sync does. If locking or installing fails,
.project.json is left as it was.
syside project add <PUBLISHER/NAME> --version-constraint <CONSTRAINT> [options]
<PUBLISHER/NAME>- the publisher and the name of the project to use, separated by/. Spell them as the project does, such as"Acme Labs/My Lib", or in lowercase with-for spaces, such asacme-labs/my-lib
If the current project already uses that project, its version constraint is replaced.
Option |
Description |
|---|---|
|
Required. The versions of the used project to allow, assuming it uses Semantic Versioning. The syntax is that of Rust’s Cargo, shown below |
The command also takes the resolution options and the global options.
The version constraints are:
Constraint |
Allows |
|---|---|
|
Any version compatible with 1.2.3: at least 1.2.3, and below 2.0.0 |
|
Exactly 1.2.3 |
|
Any version below 2, or any version from 3 on |
|
Any version that satisfies both |
|
Any version, excluding prereleases |
For example, to use any 1.x version of acme-labs/widgets:
syside project add acme-labs/widgets --version-constraint ^1
The report generation example shows a
model that uses the SysideViews library from the Sysand index.
Lock command
Resolves the current project’s usages, and the usages of the projects they name
in turn, to exact versions, and writes them to sysand-lock.toml. It does not
install them, use sync afterwards to do that.
syside project lock [options]
The command takes the resolution options and the global options.
Sync command
Installs the projects in the current project’s lockfile into .sysand, creating
.sysand if it does not exist, and removes the projects the lockfile no longer
lists. Without a lockfile, it locks first.
Run it after cloning a project that has a lockfile, or after the lockfile changes.
syside project sync [options]
The command takes the resolution options and the global options.
Resolution options
add, lock and sync find projects in indexes. The default index is
https://sysand.com.
Option |
Description |
|---|---|
|
An index to search before the default ones. Repeat the option, or separate
URLs with commas, to give several. Defaults to the |
|
An index to use instead of the default index. Repeat the option, or separate
URLs with commas, to give several. Defaults to the |
|
Do not use any index. Cannot be combined with |
Global options
Option |
Description |
|---|---|
|
Display the help message of the command |
|
Use verbose output |
|
Do not output log messages. Cannot be combined with |
|
Do not read |
|
Also read the configuration file at |
Configuration
Warning
Coming soon. Configuration file locations, their precedence, merging and supported options are currently unstable and will change in the future.
Authentication
An index that needs credentials is authenticated with the credentials stored
in the operating system’s credential store by Sysand’s sysand auth login, and
with credentials given in environment variables. Each set of credentials has a
label, <LABEL>, of your choosing:
Environment variable |
Contents |
|---|---|
|
The URLs the credentials are for, as a glob pattern such as
|
|
A bearer token |
|
The name and the password to authenticate with, using HTTP basic authentication |
Environment variables
Variable |
Effect |
|---|---|
|
Comma-separated indexes to search before the default ones, when
|
|
Comma-separated indexes to use instead of the default index, when
|
|
When set to anything other than an empty value, |
|
The same as |
|
Credentials for indexes: see Authentication |
Exit codes
Code |
Meaning |
|---|---|
|
The command succeeded |
|
The command failed, for example because the current directory is not inside a project or no compatible set of versions exists |
|
The command line is not valid, for example because an option is unknown |
Python API
The project module offers the commands as functions:
Function |
Description |
|---|---|
|
|
|
|
|
|
|
The functions take their arguments as keywords only. They read the same environment variables, credentials and configuration files as the commands.
import syside.project
syside.project.init(
project_dir="drone",
name="Drone",
publisher="Acme Labs",
version="0.1.0",
metamodel="sysml",
kind=syside.project.ProjectKind.PROJECT_JSON,
license="MIT",
)
syside.project.add(
project_dir="drone",
publisher="acme-labs",
name="widgets",
version_constraint="^1",
)