sysand 0.0.8__cp314-cp314t-win32.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of sysand might be problematic. Click here for more details.
- sysand/__init__.py +70 -0
- sysand/__main__.py +16 -0
- sysand/_add.py +16 -0
- sysand/_build.py +16 -0
- sysand/_exclude.py +19 -0
- sysand/_include.py +26 -0
- sysand/_info.py +40 -0
- sysand/_model.py +44 -0
- sysand/_new.py +26 -0
- sysand/_remove.py +16 -0
- sysand/_sources.py +29 -0
- sysand/_sysand_core.cp314t-win32.pyd +0 -0
- sysand/env/__init__.py +26 -0
- sysand/env/_install.py +16 -0
- sysand/env/_sources.py +27 -0
- sysand/py.typed +0 -0
- sysand-0.0.8.dist-info/METADATA +323 -0
- sysand-0.0.8.dist-info/RECORD +20 -0
- sysand-0.0.8.dist-info/WHEEL +4 -0
- sysand-0.0.8.dist-info/entry_points.txt +2 -0
sysand/__init__.py
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: © 2025 Sysand contributors <opensource@sensmetry.com>
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: MIT OR Apache-2.0
|
|
4
|
+
|
|
5
|
+
from ._model import (
|
|
6
|
+
InterchangeProjectUsage,
|
|
7
|
+
InterchangeProjectInfo,
|
|
8
|
+
InterchangeProjectChecksum,
|
|
9
|
+
InterchangeProjectMetadata,
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
from ._info import info_path, info
|
|
13
|
+
|
|
14
|
+
from . import env
|
|
15
|
+
|
|
16
|
+
from ._new import (
|
|
17
|
+
init,
|
|
18
|
+
new,
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
from ._add import (
|
|
22
|
+
add,
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
from ._remove import (
|
|
27
|
+
remove,
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
from ._include import (
|
|
31
|
+
include,
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
from ._exclude import (
|
|
35
|
+
exclude,
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
from ._sources import (
|
|
40
|
+
sources,
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
from ._build import build
|
|
44
|
+
|
|
45
|
+
__all__ = [
|
|
46
|
+
"InterchangeProjectUsage",
|
|
47
|
+
"InterchangeProjectInfo",
|
|
48
|
+
"InterchangeProjectChecksum",
|
|
49
|
+
"InterchangeProjectMetadata",
|
|
50
|
+
## Add
|
|
51
|
+
"add",
|
|
52
|
+
## Remove
|
|
53
|
+
"remove",
|
|
54
|
+
## Env
|
|
55
|
+
"env",
|
|
56
|
+
## info
|
|
57
|
+
"info_path",
|
|
58
|
+
"info",
|
|
59
|
+
## New
|
|
60
|
+
"init",
|
|
61
|
+
"new",
|
|
62
|
+
## Build
|
|
63
|
+
"build",
|
|
64
|
+
## Include
|
|
65
|
+
"include",
|
|
66
|
+
## Exclude
|
|
67
|
+
"exclude",
|
|
68
|
+
## Sources
|
|
69
|
+
"sources",
|
|
70
|
+
]
|
sysand/__main__.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: © 2025 Sysand contributors <opensource@sensmetry.com>
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: MIT OR Apache-2.0
|
|
4
|
+
|
|
5
|
+
import sys
|
|
6
|
+
|
|
7
|
+
import sysand._sysand_core as sysand_rs # type: ignore
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def main() -> int:
|
|
11
|
+
is_success = sysand_rs._run_cli(["sysand"] + sys.argv[1:])
|
|
12
|
+
return 0 if is_success else 1
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
if __name__ == "__main__":
|
|
16
|
+
sys.exit(main())
|
sysand/_add.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: © 2025 Sysand contributors <opensource@sensmetry.com>
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: MIT OR Apache-2.0
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
import sysand._sysand_core as sysand_rs # type: ignore
|
|
8
|
+
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def add(path: Path | str, iri: str, version: str | None = None) -> None:
|
|
13
|
+
sysand_rs.do_add_py(str(path), iri, version)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
__all__ = ["add"]
|
sysand/_build.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import sysand._sysand_core as sysand_rs # type: ignore
|
|
4
|
+
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def build(output_path: str | Path, project_path: str | Path | None = None) -> None:
|
|
9
|
+
if project_path is not None:
|
|
10
|
+
project_path = str(project_path)
|
|
11
|
+
sysand_rs.do_build_py(str(output_path), project_path)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
__all__ = [
|
|
15
|
+
"build",
|
|
16
|
+
]
|
sysand/_exclude.py
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: © 2025 Sysand contributors <opensource@sensmetry.com>
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: MIT OR Apache-2.0
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
import sysand._sysand_core as sysand_rs # type: ignore
|
|
8
|
+
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def exclude(
|
|
13
|
+
path: Path | str,
|
|
14
|
+
src_path: str | Path,
|
|
15
|
+
) -> None:
|
|
16
|
+
sysand_rs.do_exclude_py(str(path), str(src_path))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
__all__ = ["exclude"]
|
sysand/_include.py
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: © 2025 Sysand contributors <opensource@sensmetry.com>
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: MIT OR Apache-2.0
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
import sysand._sysand_core as sysand_rs # type: ignore
|
|
8
|
+
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
from typing import Literal
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def include(
|
|
14
|
+
path: str | Path,
|
|
15
|
+
src_path: str | Path,
|
|
16
|
+
*,
|
|
17
|
+
compute_checksum: bool = False,
|
|
18
|
+
index_symbols: bool = True,
|
|
19
|
+
force_format: Literal["sysml", "kerml"] | None = None,
|
|
20
|
+
) -> None:
|
|
21
|
+
sysand_rs.do_include_py(
|
|
22
|
+
str(path), str(src_path), compute_checksum, index_symbols, force_format
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
__all__ = ["include"]
|
sysand/_info.py
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: © 2025 Sysand contributors <opensource@sensmetry.com>
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: MIT OR Apache-2.0
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
from ._model import InterchangeProjectInfo, InterchangeProjectMetadata
|
|
8
|
+
|
|
9
|
+
import sysand._sysand_core as sysand_rs # type: ignore
|
|
10
|
+
|
|
11
|
+
import typing
|
|
12
|
+
from pathlib import Path
|
|
13
|
+
from os import getcwd
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def info_path(
|
|
17
|
+
path: str | Path = ".",
|
|
18
|
+
) -> typing.Tuple[InterchangeProjectInfo, InterchangeProjectMetadata] | None:
|
|
19
|
+
return sysand_rs.do_info_py_path(str(path)) # type: ignore
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def info(
|
|
23
|
+
uri: str,
|
|
24
|
+
*,
|
|
25
|
+
relative_file_root: str | Path | None = None,
|
|
26
|
+
index_urls: str | typing.List[str] | None = None,
|
|
27
|
+
) -> typing.List[typing.Tuple[InterchangeProjectInfo, InterchangeProjectMetadata]]:
|
|
28
|
+
if relative_file_root is None:
|
|
29
|
+
relative_file_root = getcwd()
|
|
30
|
+
|
|
31
|
+
if isinstance(index_urls, str):
|
|
32
|
+
index_urls = [index_urls]
|
|
33
|
+
|
|
34
|
+
return sysand_rs.do_info_py(uri, relative_file_root, index_urls) # type: ignore
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
__all__ = [
|
|
38
|
+
"info_path",
|
|
39
|
+
"info",
|
|
40
|
+
]
|
sysand/_model.py
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: © 2025 Sysand contributors <opensource@sensmetry.com>
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: MIT OR Apache-2.0
|
|
4
|
+
|
|
5
|
+
import typing
|
|
6
|
+
import datetime
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class InterchangeProjectUsage(typing.TypedDict):
|
|
10
|
+
resource: str
|
|
11
|
+
version_constraint: typing.Optional[str]
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class InterchangeProjectInfo(typing.TypedDict):
|
|
15
|
+
name: str
|
|
16
|
+
description: typing.Optional[str]
|
|
17
|
+
version: str
|
|
18
|
+
license: typing.Optional[str]
|
|
19
|
+
maintainer: typing.List[str]
|
|
20
|
+
website: typing.Optional[str]
|
|
21
|
+
topic: typing.List[str]
|
|
22
|
+
usage: typing.List[InterchangeProjectUsage]
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class InterchangeProjectChecksum(typing.TypedDict):
|
|
26
|
+
value: str
|
|
27
|
+
algorithm: str
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class InterchangeProjectMetadata(typing.TypedDict):
|
|
31
|
+
index: typing.Dict[str, str]
|
|
32
|
+
created: datetime.datetime
|
|
33
|
+
metamodel: typing.Optional[str]
|
|
34
|
+
includes_derived: typing.Optional[bool]
|
|
35
|
+
includes_implied: typing.Optional[bool]
|
|
36
|
+
checksum: typing.Optional[typing.List[InterchangeProjectChecksum]]
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
__all__ = [
|
|
40
|
+
"InterchangeProjectUsage",
|
|
41
|
+
"InterchangeProjectInfo",
|
|
42
|
+
"InterchangeProjectChecksum",
|
|
43
|
+
"InterchangeProjectMetadata",
|
|
44
|
+
]
|
sysand/_new.py
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: © 2025 Sysand contributors <opensource@sensmetry.com>
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: MIT OR Apache-2.0
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
import sysand._sysand_core as sysand_rs # type: ignore
|
|
8
|
+
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def init(name: str, version: str, path: str | Path = ".") -> None:
|
|
13
|
+
sysand_rs.do_new_py_local_file(name, version, str(path))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def new(name: str, version: str, path: str | Path = ".") -> None:
|
|
17
|
+
if not Path(path).exists():
|
|
18
|
+
Path(path).mkdir()
|
|
19
|
+
|
|
20
|
+
sysand_rs.do_new_py_local_file(name, version, str(path))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
__all__ = [
|
|
24
|
+
"init",
|
|
25
|
+
"new",
|
|
26
|
+
]
|
sysand/_remove.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: © 2025 Sysand contributors <opensource@sensmetry.com>
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: MIT OR Apache-2.0
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
import sysand._sysand_core as sysand_rs # type: ignore
|
|
8
|
+
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def remove(path: Path | str, iri: str) -> None:
|
|
13
|
+
sysand_rs.do_remove_py(str(path), iri)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
__all__ = ["remove"]
|
sysand/_sources.py
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: © 2025 Sysand contributors <opensource@sensmetry.com>
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: MIT OR Apache-2.0
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
from typing import List
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
|
|
9
|
+
import sysand._sysand_core as sysand_rs # type: ignore
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def sources(
|
|
13
|
+
path: str | Path,
|
|
14
|
+
*,
|
|
15
|
+
include_deps: bool = True,
|
|
16
|
+
env_path: str | Path | None = None,
|
|
17
|
+
include_std: bool = False,
|
|
18
|
+
) -> List[Path]:
|
|
19
|
+
if env_path is not None:
|
|
20
|
+
env_path = str(env_path)
|
|
21
|
+
|
|
22
|
+
return sysand_rs.do_sources_project_py( # type: ignore
|
|
23
|
+
str(path), include_deps, env_path, include_std
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
__all__ = [
|
|
28
|
+
"sources",
|
|
29
|
+
]
|
|
Binary file
|
sysand/env/__init__.py
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: © 2025 Sysand contributors <opensource@sensmetry.com>
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: MIT OR Apache-2.0
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
import sysand._sysand_core as sysand_rs # type: ignore
|
|
8
|
+
from sysand._sysand_core import DEFAULT_ENV_NAME
|
|
9
|
+
|
|
10
|
+
from ._install import (
|
|
11
|
+
install_path,
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
from pathlib import Path
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def env(path: str | Path = DEFAULT_ENV_NAME) -> None:
|
|
18
|
+
sysand_rs.do_env_py_local_dir(str(path))
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
__all__ = [
|
|
22
|
+
"env",
|
|
23
|
+
"DEFAULT_ENV_NAME",
|
|
24
|
+
## Install
|
|
25
|
+
"install_path",
|
|
26
|
+
]
|
sysand/env/_install.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: © 2025 Sysand contributors <opensource@sensmetry.com>
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: MIT OR Apache-2.0
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
import sysand._sysand_core as sysand_rs # type: ignore
|
|
8
|
+
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def install_path(env_path: str | Path, iri: str, location: str | Path) -> None:
|
|
13
|
+
sysand_rs.do_env_install_path_py(str(env_path), iri, str(location))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
__all__ = ["install_path"]
|
sysand/env/_sources.py
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: © 2025 Sysand contributors <opensource@sensmetry.com>
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: MIT OR Apache-2.0
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
from typing import List
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
|
|
9
|
+
import sysand._sysand_core as sysand_rs # type: ignore
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def sources(
|
|
13
|
+
env_path: str | Path,
|
|
14
|
+
iri: str,
|
|
15
|
+
version: str | None = None,
|
|
16
|
+
*,
|
|
17
|
+
include_deps: bool = True,
|
|
18
|
+
include_std: bool = False,
|
|
19
|
+
) -> List[Path]:
|
|
20
|
+
return sysand_rs.do_sources_env_py( # type: ignore
|
|
21
|
+
str(env_path), iri, version, include_deps, include_std
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
__all__ = [
|
|
26
|
+
"sources",
|
|
27
|
+
]
|
sysand/py.typed
ADDED
|
File without changes
|
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: sysand
|
|
3
|
+
Version: 0.0.8
|
|
4
|
+
Classifier: Programming Language :: Python
|
|
5
|
+
Classifier: Programming Language :: Rust
|
|
6
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
7
|
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
8
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: Topic :: Scientific/Engineering
|
|
17
|
+
Summary: A package manager for SysML v2 and KerML
|
|
18
|
+
Home-Page: https://beta.sysand.org
|
|
19
|
+
Maintainer-email: Sensmetry <opensource@sensmetry.com>
|
|
20
|
+
License-Expression: MIT OR Apache-2.0
|
|
21
|
+
Requires-Python: >=3.8
|
|
22
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
23
|
+
Project-URL: documentation, https://docs.sysand.org
|
|
24
|
+
Project-URL: forum, https://forum.sensmetry.com/c/sysand/24
|
|
25
|
+
Project-URL: homepage, https://beta.sysand.org
|
|
26
|
+
Project-URL: issues, https://github.com/sensmetry/sysand/issues
|
|
27
|
+
Project-URL: source, https://github.com/sensmetry/sysand
|
|
28
|
+
|
|
29
|
+
# Sysand: a package manager for SysML v2 and KerML
|
|
30
|
+
|
|
31
|
+
> [!important]
|
|
32
|
+
> This is an early preview release, intended for early adopters
|
|
33
|
+
> to test, integrate, and give feedback. While we hope to keep the tool in a
|
|
34
|
+
> usable state, interfaces are subject to change and usability will likely not
|
|
35
|
+
> yet be representative of a stable release.
|
|
36
|
+
|
|
37
|
+
This repository contains Sysand, a [package
|
|
38
|
+
manager](https://en.wikipedia.org/wiki/Package_manager) for SysML v2 and KerML
|
|
39
|
+
similar to package managers for programming languages such as Pip for Python,
|
|
40
|
+
NPM for JavaScript, Maven for Java, and NuGet for .NET. Sysand is based on a
|
|
41
|
+
concept of a model interchange project, a slight generalization of a project
|
|
42
|
+
interchange file (`*.kpar`), defined in [KerML clause
|
|
43
|
+
10.3](https://www.omg.org/spec/KerML/1.0/PDF#page=432).
|
|
44
|
+
|
|
45
|
+
Sysand can be used as a standalone tool through its command line interface (CLI)
|
|
46
|
+
or be integrated into other tools through one of its APIs (currently, Python and
|
|
47
|
+
Java are supported).
|
|
48
|
+
|
|
49
|
+
The following section provides basic information on how to use Sysand via CLI.
|
|
50
|
+
The later sections provide information relevant for potential contributors.
|
|
51
|
+
|
|
52
|
+
## Basic use via the command line interface
|
|
53
|
+
|
|
54
|
+
### Installation
|
|
55
|
+
|
|
56
|
+
Sysand is written in Rust programming language. To build it, [install
|
|
57
|
+
Rust](https://www.rust-lang.org/tools/install) and run the following command in
|
|
58
|
+
the terminal:
|
|
59
|
+
|
|
60
|
+
```sh
|
|
61
|
+
cargo install sysand --git=https://github.com/sensmetry/sysand.git
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
With Sysand installed, you can now create a model interchange project as shown
|
|
65
|
+
in the following subsection.
|
|
66
|
+
|
|
67
|
+
### Model interchange projects
|
|
68
|
+
|
|
69
|
+
A model interchange project is a collection of SysML v2 (`.sysml`) or KerML (`.kerml`)
|
|
70
|
+
files with additional metadata such as project name, versions, and the list of
|
|
71
|
+
projects on which it depends. To create a new project called `my_project` run:
|
|
72
|
+
|
|
73
|
+
```console
|
|
74
|
+
$ sysand new my_project
|
|
75
|
+
Creating interchange project `my_project`
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
This creates a new directory (`my_project`) and populates it with a minimal
|
|
79
|
+
interchange project, consisting of two files `.project.json` and `.meta.json`.
|
|
80
|
+
|
|
81
|
+
Inside the directory, we can ask for a basic overview of the project.
|
|
82
|
+
|
|
83
|
+
```console
|
|
84
|
+
$ cd my_project
|
|
85
|
+
$ sysand info
|
|
86
|
+
Name: my_project
|
|
87
|
+
Version: 0.0.1
|
|
88
|
+
No usages.
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Source files
|
|
92
|
+
|
|
93
|
+
The project we created in the previous subsection contains no source files as
|
|
94
|
+
can be seen by running the following command:
|
|
95
|
+
|
|
96
|
+
```console
|
|
97
|
+
$ sysand sources
|
|
98
|
+
<NO OUTPUT>
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Before we can add source files to the project, we need to create them. Create
|
|
102
|
+
`MyProject.sysml` file with the following content:
|
|
103
|
+
|
|
104
|
+
```sysml
|
|
105
|
+
package MyProject;
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Now, we can add `MyProject.sysml` to our project by running the following
|
|
109
|
+
command:
|
|
110
|
+
|
|
111
|
+
```console
|
|
112
|
+
$ sysand include MyProject.sysml
|
|
113
|
+
Including files: ["MyProject.sysml"]
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
The file will now be listed by `sysand sources`, which can serve as the input
|
|
117
|
+
to a SysML v2 processing environment.
|
|
118
|
+
|
|
119
|
+
```console
|
|
120
|
+
$ sysand sources
|
|
121
|
+
/path/to/my_project/MyProject.sysml
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
The following subsection shows how to add dependencies to our project.
|
|
125
|
+
|
|
126
|
+
### Dependencies
|
|
127
|
+
|
|
128
|
+
Effectively all projects depend on elements defined in other projects. The key
|
|
129
|
+
benefit of Sysand is that it can automatically manage project dependencies for
|
|
130
|
+
you.
|
|
131
|
+
|
|
132
|
+
KerML (and by extension in SysML v2) specification calls a project dependency a
|
|
133
|
+
usage. Each usage is identified by an [Internationalized Resource Identifier
|
|
134
|
+
(IRI)](https://en.wikipedia.org/wiki/Internationalized_Resource_Identifier) with
|
|
135
|
+
an optional version constraint. To add dependencies, use the `sysand add`
|
|
136
|
+
command. The simplest way to use it is to give an IRI to a package you want to
|
|
137
|
+
install from the [Sysand Package Index](https://sysand.org). You can find the
|
|
138
|
+
IRI (and the full install command) in the card of the package on the index
|
|
139
|
+
website. For example, to install the standard Function Library, run:
|
|
140
|
+
|
|
141
|
+
```console
|
|
142
|
+
$ sysand add urn:kpar:function-library
|
|
143
|
+
Adding usage: urn:kpar:function-library
|
|
144
|
+
Creating env
|
|
145
|
+
Syncing env
|
|
146
|
+
Installing urn:kpar:semantic-library 1.0.0
|
|
147
|
+
Installing urn:kpar:data-type-library 1.0.0
|
|
148
|
+
Installing urn:kpar:function-library 1.0.0
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
It is also possible to install packages from the URL that points to the `.kpar`
|
|
152
|
+
file as shown in the following snippet:
|
|
153
|
+
|
|
154
|
+
```console
|
|
155
|
+
$ sysand add https://www.omg.org/spec/KerML/20250201/Function-Library.kpar
|
|
156
|
+
Adding usage: https://www.omg.org/spec/KerML/20250201/Function-Library.kpar
|
|
157
|
+
Creating env
|
|
158
|
+
Syncing env
|
|
159
|
+
Installing https://www.omg.org/spec/KerML/20250201/Semantic-Library.kpar 1.0.0
|
|
160
|
+
Installing https://www.omg.org/spec/KerML/20250201/Data-Type-Library.kpar 1.0.0
|
|
161
|
+
Installing https://www.omg.org/spec/KerML/20250201/Function-Library.kpar 1.0.0
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Adding a dependency may take a few seconds to run, as it will find and install
|
|
165
|
+
the project (and any transitive usages) into a new local environment. Once
|
|
166
|
+
finished, this will have created a file called `sysand-lock.toml` and a directory
|
|
167
|
+
`sysand_env`. The former records the precise versions installed, so that the
|
|
168
|
+
same installation can be reproduced later. The latter directory will contain a
|
|
169
|
+
local installation of the added project, as well as any of its (transitive)
|
|
170
|
+
usages. `sysand-lock.toml` is sufficient to reproduce `sysand_env`; therefore, we
|
|
171
|
+
recommend checking in `sysand-lock.toml` into your version control system and
|
|
172
|
+
adding `sysand_env` to `.gitignore`.
|
|
173
|
+
|
|
174
|
+
We can confirm that the usage was successfully added by running the `info`
|
|
175
|
+
command again:
|
|
176
|
+
|
|
177
|
+
```console
|
|
178
|
+
$ sysand info
|
|
179
|
+
Name: my_project
|
|
180
|
+
Version: 0.0.1
|
|
181
|
+
Usages:
|
|
182
|
+
https://www.omg.org/spec/KerML/20250201/Semantic-Library.kpar
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
If we run `sysand source` again, it will now include all source files of the
|
|
186
|
+
set of (transitive) dependencies.
|
|
187
|
+
|
|
188
|
+
```console
|
|
189
|
+
$ sysand sources
|
|
190
|
+
/Users/vakaras2/projects/tmp/sysand/sysand_env/7afe310696b522f251dc21ed6086ac4b50a663969fd1a49aa0aa2103d2a674ad/1.0.0.kpar/Metaobjects.kerml
|
|
191
|
+
/Users/vakaras2/projects/tmp/sysand/sysand_env/7afe310696b522f251dc21ed6086ac4b50a663969fd1a49aa0aa2103d2a674ad/1.0.0.kpar/Performances.kerml
|
|
192
|
+
/Users/vakaras2/projects/tmp/sysand/sysand_env/7afe310696b522f251dc21ed6086ac4b50a663969fd1a49aa0aa2103d2a674ad/1.0.0.kpar/Links.kerml
|
|
193
|
+
/Users/vakaras2/projects/tmp/sysand/sysand_env/7afe310696b522f251dc21ed6086ac4b50a663969fd1a49aa0aa2103d2a674ad/1.0.0.kpar/SpatialFrames.kerml
|
|
194
|
+
/Users/vakaras2/projects/tmp/sysand/sysand_env/7afe310696b522f251dc21ed6086ac4b50a663969fd1a49aa0aa2103d2a674ad/1.0.0.kpar/Clocks.kerml
|
|
195
|
+
...
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### Environments
|
|
199
|
+
|
|
200
|
+
When we executed `sysand add` in the previous subsection, it implicitly created
|
|
201
|
+
and synchronized an *environment* for us. For users familiar with Python, Sysand
|
|
202
|
+
environments serve the same purpose as Python virtual environments: they store
|
|
203
|
+
dependencies needed for a specific project.
|
|
204
|
+
|
|
205
|
+
We can see everything installed in the local environment using `sysand env
|
|
206
|
+
list`:
|
|
207
|
+
|
|
208
|
+
```console
|
|
209
|
+
$ sysand env list
|
|
210
|
+
https://www.omg.org/spec/KerML/20250201/Data-Type-Library.kpar 1.0.0
|
|
211
|
+
https://www.omg.org/spec/KerML/20250201/Function-Library.kpar 1.0.0
|
|
212
|
+
https://www.omg.org/spec/KerML/20250201/Semantic-Library.kpar 1.0.0
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
If you want to recreate the environment on a new machine, make sure you have not
|
|
216
|
+
only your project files, but also `sysand-lock.toml` and execute the following
|
|
217
|
+
command:
|
|
218
|
+
|
|
219
|
+
```console
|
|
220
|
+
$ sysand sync
|
|
221
|
+
Creating env
|
|
222
|
+
Syncing env
|
|
223
|
+
Installing https://www.omg.org/spec/KerML/20250201/Data-Type-Library.kpar 1.0.0
|
|
224
|
+
Installing https://www.omg.org/spec/KerML/20250201/Semantic-Library.kpar 1.0.0
|
|
225
|
+
Installing https://www.omg.org/spec/KerML/20250201/Function-Library.kpar 1.0.0
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
### Packaging projects for distribution
|
|
229
|
+
|
|
230
|
+
To package your project for distribution, run `sysand build`:
|
|
231
|
+
|
|
232
|
+
```console
|
|
233
|
+
$ sysand build
|
|
234
|
+
Building kpar: /path/to/my_project/output/my_project.kpar
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
This command creates a `my_project.kpar` file that can be installed in a
|
|
238
|
+
different project using `sysand`.
|
|
239
|
+
|
|
240
|
+
## Hosting a project index
|
|
241
|
+
|
|
242
|
+
> [!important]
|
|
243
|
+
> The structure of indexes and `sysand_env` environments is still expected to
|
|
244
|
+
> change, and may currently not be compatible between sysand releases.
|
|
245
|
+
|
|
246
|
+
The easiest way to host a project index from which to install packages is to
|
|
247
|
+
expose a `sysand_env` over HTTP.
|
|
248
|
+
|
|
249
|
+
If you have an existing `sysand_env`, and you have a working Python 3 environment
|
|
250
|
+
you can test this with
|
|
251
|
+
|
|
252
|
+
```console
|
|
253
|
+
$ python3 -m http.server -d sysand_env 8080
|
|
254
|
+
Serving HTTP on 0.0.0.0 port 8080 (http://0.0.0.0:8080/) ...
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
> [!important]
|
|
258
|
+
> Python's built-in `http.server` module is *not* intended for production use.
|
|
259
|
+
|
|
260
|
+
Any project in the above `sysand_env` can now be used in `sysand add`, `sysand sync`,
|
|
261
|
+
`sysand env install`, etc., as long as the flag `--use-index http://localhost:8080`
|
|
262
|
+
is added (or soon by specifying it in `sysand.toml`!).
|
|
263
|
+
|
|
264
|
+
For example, to create an index to publish the above `my_project` project we can
|
|
265
|
+
create a fresh `sysand_env`.
|
|
266
|
+
|
|
267
|
+
```console
|
|
268
|
+
$ mkdir my_index
|
|
269
|
+
$ cd my_index
|
|
270
|
+
$ sysand env
|
|
271
|
+
Creating env
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
Now we install `my_project`, specifying the IRI/URL that you want to use to refer
|
|
275
|
+
to it:
|
|
276
|
+
|
|
277
|
+
```console
|
|
278
|
+
$ sysand env install urn:kpar:my_project --path /path/to/my_project/
|
|
279
|
+
Installing urn:kpar:my_project 0.0.1
|
|
280
|
+
Syncing env
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
By default, this will also install any usages (dependencies) of `my_project`, you
|
|
284
|
+
can use `--no-deps` to install only the project itself.
|
|
285
|
+
|
|
286
|
+
## Documentation
|
|
287
|
+
|
|
288
|
+
The "Sysand User Guide" is currently a work in progress. To preview make sure
|
|
289
|
+
you have `mdbook` installed (`cargo install mdbook`), then either run
|
|
290
|
+
|
|
291
|
+
```sh
|
|
292
|
+
mdbook build docs/
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
and open `docs/book/index.html`, or run
|
|
296
|
+
|
|
297
|
+
```sh
|
|
298
|
+
mdbook serve docs/
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
and open [localhost:3000](http://localhost:3000/).
|
|
302
|
+
|
|
303
|
+
## Contributing
|
|
304
|
+
|
|
305
|
+
### Development
|
|
306
|
+
|
|
307
|
+
Development instructions are provided in [DEVELOPMENT.md](DEVELOPMENT.md).
|
|
308
|
+
|
|
309
|
+
### Legal
|
|
310
|
+
|
|
311
|
+
For contributors' guidelines regarding legal matters, please see the
|
|
312
|
+
[CONTRIBUTING.md](CONTRIBUTING.md) file.
|
|
313
|
+
|
|
314
|
+
## Licensing
|
|
315
|
+
|
|
316
|
+
The implementation is dual-licensed under the MIT and Apache-2.0 licenses,
|
|
317
|
+
meaning users may choose to use the code under *either* license. Contributors
|
|
318
|
+
agree to provide contributed code under **both** licenses.
|
|
319
|
+
|
|
320
|
+
Sysand is maintained by [Sensmetry](https://www.sensmetry.com), with
|
|
321
|
+
contributions from the community. To see the complete list of contributors,
|
|
322
|
+
please see the git history.
|
|
323
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
sysand\__init__.py,sha256=GJulh1CLw6q4kHZStUkhk6ZiKJyPRyMx9TXjGj5KG-o,1067
|
|
2
|
+
sysand\__main__.py,sha256=ADcyQWTtVaXN7zKd3aFRNZ6Y_0sNfjNjK9HDmRi9MHc,381
|
|
3
|
+
sysand\_add.py,sha256=WD7--AX7Sqh505WQT4r9P1Vu3OzWLPJ09tHGLCcIhec,407
|
|
4
|
+
sysand\_build.py,sha256=qm7TmPq4T8GHXaFzTFAXv8QAIwhjG9rjxNziJ-M3Q3I,381
|
|
5
|
+
sysand\_exclude.py,sha256=5w_APpgAP9cKdNMEBe7k_ytEP3GK38hkOgb7129Fk6w,418
|
|
6
|
+
sysand\_include.py,sha256=HcnBKyyjO4-l_W2aRro8v6_TBIrqlTK5jxaBbNUhlwQ,647
|
|
7
|
+
sysand\_info.py,sha256=GJvtkNEvmQlQViTbZ72GomSzrxH4w_dU3ZnRU77ar0M,1078
|
|
8
|
+
sysand\_model.py,sha256=_5ar9z6I85WNdBkbeNMK1Jls-F6IVU00O-lE6wcfHLw,1159
|
|
9
|
+
sysand\_new.py,sha256=RJ3RqljJfVWyBWy2jyc5qaVrLmnZcIlaBNxBBysMccs,631
|
|
10
|
+
sysand\_remove.py,sha256=5uQwC7xHVKXRwAvZz0GESjn3EpMH0gou8zKoTd-uTsA,379
|
|
11
|
+
sysand\_sources.py,sha256=xkMnI2WXWH-wyKyn_XqGHoduI7O-MxraOwSfBW4sxt4,677
|
|
12
|
+
sysand\_sysand_core.cp314t-win32.pyd,sha256=OI-ynBDOjJfWRf4Gbab6YjNBqSVVeP19XbLv1_zzSWY,12360192
|
|
13
|
+
sysand\env\__init__.py,sha256=If2NrgPoBTLEGz6KOD9ZoAhxVvYnlp4DqWZ8lUZiD1M,554
|
|
14
|
+
sysand\env\_install.py,sha256=Umu83QkMo0RVdkvE1hL4AuDUuJyQQLD7D8ML5h8dLlU,446
|
|
15
|
+
sysand\env\_sources.py,sha256=U7TlSw_Mei0XJe4Orlsj11-XLNYcwr9hbIlULjZwp1U,626
|
|
16
|
+
sysand\py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
17
|
+
sysand-0.0.8.dist-info\METADATA,sha256=4wuttjgfIAZ_uPksxHF7r3vxN4IV6NaosdA9h-vdcxo,11728
|
|
18
|
+
sysand-0.0.8.dist-info\WHEEL,sha256=xxwa8LdU-3r9HpXNnZn_vYNRdn0qDCsd2PKLoQ8uVMw,94
|
|
19
|
+
sysand-0.0.8.dist-info\entry_points.txt,sha256=C8RV8Ng8Qac0EavVG0nngQWiy4s8F4Tad_wswTzks6E,46
|
|
20
|
+
sysand-0.0.8.dist-info\RECORD,,
|