tlaplus-cli 0.2.1__tar.gz → 0.3.1__tar.gz
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.
- {tlaplus_cli-0.2.1/src/tlaplus_cli.egg-info → tlaplus_cli-0.3.1}/PKG-INFO +37 -24
- {tlaplus_cli-0.2.1 → tlaplus_cli-0.3.1}/README.md +35 -23
- {tlaplus_cli-0.2.1 → tlaplus_cli-0.3.1}/pyproject.toml +2 -1
- tlaplus_cli-0.3.1/src/tlaplus_cli/__init__.py +6 -0
- {tlaplus_cli-0.2.1 → tlaplus_cli-0.3.1}/src/tlaplus_cli/cli.py +5 -5
- {tlaplus_cli-0.2.1 → tlaplus_cli-0.3.1}/src/tlaplus_cli/run_tlc.py +2 -2
- tlaplus_cli-0.2.1/src/tlaplus_cli/tlc_manager.py → tlaplus_cli-0.3.1/src/tlaplus_cli/tools_manager.py +125 -68
- {tlaplus_cli-0.2.1 → tlaplus_cli-0.3.1}/src/tlaplus_cli/version_manager.py +95 -20
- {tlaplus_cli-0.2.1 → tlaplus_cli-0.3.1/src/tlaplus_cli.egg-info}/PKG-INFO +37 -24
- {tlaplus_cli-0.2.1 → tlaplus_cli-0.3.1}/src/tlaplus_cli.egg-info/SOURCES.txt +2 -2
- {tlaplus_cli-0.2.1 → tlaplus_cli-0.3.1}/src/tlaplus_cli.egg-info/requires.txt +1 -0
- {tlaplus_cli-0.2.1 → tlaplus_cli-0.3.1}/tests/test_java_module_naming.py +2 -2
- {tlaplus_cli-0.2.1 → tlaplus_cli-0.3.1}/tests/test_run_tlc.py +5 -5
- tlaplus_cli-0.3.1/tests/test_tools_manager.py +631 -0
- tlaplus_cli-0.3.1/tests/test_version_manager.py +193 -0
- tlaplus_cli-0.2.1/src/tlaplus_cli/__init__.py +0 -0
- tlaplus_cli-0.2.1/tests/test_tlc_manager.py +0 -355
- tlaplus_cli-0.2.1/tests/test_version_manager.py +0 -70
- {tlaplus_cli-0.2.1 → tlaplus_cli-0.3.1}/LICENSE +0 -0
- {tlaplus_cli-0.2.1 → tlaplus_cli-0.3.1}/MANIFEST.in +0 -0
- {tlaplus_cli-0.2.1 → tlaplus_cli-0.3.1}/setup.cfg +0 -0
- {tlaplus_cli-0.2.1 → tlaplus_cli-0.3.1}/src/tlaplus_cli/build_tlc_module.py +0 -0
- {tlaplus_cli-0.2.1 → tlaplus_cli-0.3.1}/src/tlaplus_cli/check_java.py +0 -0
- {tlaplus_cli-0.2.1 → tlaplus_cli-0.3.1}/src/tlaplus_cli/config.py +0 -0
- {tlaplus_cli-0.2.1 → tlaplus_cli-0.3.1}/src/tlaplus_cli/py.typed +0 -0
- {tlaplus_cli-0.2.1 → tlaplus_cli-0.3.1}/src/tlaplus_cli/resources/default_config.yaml +0 -0
- {tlaplus_cli-0.2.1 → tlaplus_cli-0.3.1}/src/tlaplus_cli/settings.py +0 -0
- {tlaplus_cli-0.2.1 → tlaplus_cli-0.3.1}/src/tlaplus_cli.egg-info/dependency_links.txt +0 -0
- {tlaplus_cli-0.2.1 → tlaplus_cli-0.3.1}/src/tlaplus_cli.egg-info/entry_points.txt +0 -0
- {tlaplus_cli-0.2.1 → tlaplus_cli-0.3.1}/src/tlaplus_cli.egg-info/top_level.txt +0 -0
- {tlaplus_cli-0.2.1 → tlaplus_cli-0.3.1}/tests/test_build_tlc_module.py +0 -0
- {tlaplus_cli-0.2.1 → tlaplus_cli-0.3.1}/tests/test_check_java.py +0 -0
- {tlaplus_cli-0.2.1 → tlaplus_cli-0.3.1}/tests/test_cli.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tlaplus-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.1
|
|
4
4
|
Summary: TLA+ tools: download TLC, compile custom modules, run model checker
|
|
5
5
|
Author-email: Denis Nikolskiy <codeomatics@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -24,6 +24,7 @@ Requires-Dist: requests<3.0.0,>=2.31.0
|
|
|
24
24
|
Requires-Dist: pyyaml<7.0,>=6.0
|
|
25
25
|
Requires-Dist: platformdirs<5.0,>=4.0
|
|
26
26
|
Requires-Dist: pydantic<3.0.0,>=2.12.5
|
|
27
|
+
Requires-Dist: truststore<1.0.0,>=0.9.0
|
|
27
28
|
Dynamic: license-file
|
|
28
29
|
|
|
29
30
|
# TLA+ CLI
|
|
@@ -50,87 +51,99 @@ uv tool uninstall tlaplus-cli
|
|
|
50
51
|
|
|
51
52
|
## Usage
|
|
52
53
|
|
|
53
|
-
### Managing
|
|
54
|
+
### Managing TLA+ Tools
|
|
54
55
|
|
|
55
|
-
The `tla
|
|
56
|
+
The `tla tools` command group allows you to download and manage multiple versions of the TLA+ toolset (TLC, SANY, TLATeX) directly from GitHub releases.
|
|
56
57
|
|
|
57
|
-
List available and installed
|
|
58
|
+
List available and installed toolset versions:
|
|
58
59
|
```bash
|
|
59
|
-
tla
|
|
60
|
+
tla tools list
|
|
60
61
|
```
|
|
61
62
|
|
|
62
|
-
Install the latest
|
|
63
|
+
Install the latest toolset version:
|
|
63
64
|
```bash
|
|
64
|
-
tla
|
|
65
|
+
tla tools install
|
|
65
66
|
```
|
|
66
67
|
|
|
67
|
-
|
|
68
|
+
> [!TIP]
|
|
69
|
+
> The first version you install is automatically "pinned" as the default. Subsequent installs won't change your pin unless you manually use `tla tools pin`.
|
|
70
|
+
|
|
71
|
+
Install a specific toolset version:
|
|
68
72
|
```bash
|
|
69
|
-
tla
|
|
73
|
+
tla tools install v1.8.0
|
|
70
74
|
```
|
|
71
75
|
|
|
72
76
|
Pin a specific version to be used by default:
|
|
73
77
|
```bash
|
|
74
|
-
tla
|
|
78
|
+
tla tools pin v1.8.0
|
|
75
79
|
```
|
|
76
80
|
|
|
77
81
|
Upgrade the pinned version (or a specific version) to a newer commit:
|
|
78
82
|
```bash
|
|
79
|
-
tla
|
|
83
|
+
tla tools upgrade
|
|
80
84
|
```
|
|
81
85
|
|
|
86
|
+
> [!NOTE]
|
|
87
|
+
> If the target version to upgrade is not yet installed locally, the CLI will automatically download it.
|
|
88
|
+
|
|
82
89
|
Show the TLC2 version string and absolute path to the pinned version's `tla2tools.jar`:
|
|
83
90
|
```bash
|
|
84
|
-
tla
|
|
91
|
+
tla tools path
|
|
85
92
|
```
|
|
86
93
|
|
|
87
94
|
Or for a specific version:
|
|
88
95
|
```bash
|
|
89
|
-
tla
|
|
96
|
+
tla tools path v1.8.0
|
|
90
97
|
```
|
|
91
98
|
|
|
92
99
|
Example output:
|
|
93
100
|
```text
|
|
94
101
|
TLC2 Version 2.19 of 08 August 2024 (rev: 5a47802)
|
|
95
|
-
/home/bob/.cache/tla/
|
|
102
|
+
/home/bob/.cache/tla/tools/v1.8.0-5a47802/tla2tools.jar
|
|
96
103
|
```
|
|
97
104
|
|
|
98
|
-
Show the
|
|
105
|
+
Show the toolset versions directory and all installed version directories:
|
|
99
106
|
```bash
|
|
100
|
-
tla
|
|
107
|
+
tla tools dir
|
|
101
108
|
```
|
|
102
109
|
|
|
103
110
|
Example output:
|
|
104
111
|
```text
|
|
105
|
-
/home/bob/.cache/tla/
|
|
112
|
+
/home/bob/.cache/tla/tools
|
|
106
113
|
v1.7.0-abc1234
|
|
107
114
|
v1.8.0-5a47802
|
|
108
115
|
```
|
|
109
116
|
|
|
110
117
|
Uninstall a specific version (or use 'default' to remove legacy jars):
|
|
111
118
|
```bash
|
|
112
|
-
tla
|
|
119
|
+
tla tools uninstall v1.8.0
|
|
113
120
|
```
|
|
114
121
|
|
|
122
|
+
> [!TIP]
|
|
123
|
+
> Use `--all` to remove all installed tags for a specific version name without interactive prompts.
|
|
124
|
+
|
|
125
|
+
> [!NOTE]
|
|
126
|
+
> If you uninstall the currently pinned version, the CLI will automatically "fall back" to the next best installed version (ranked by semver, then release date).
|
|
127
|
+
|
|
115
128
|
### Run TLC
|
|
116
129
|
|
|
117
|
-
Run the TLC model checker on a specification. This uses the currently pinned
|
|
130
|
+
Run the TLC model checker on a specification. This uses the currently pinned toolset version.
|
|
118
131
|
|
|
119
132
|
```bash
|
|
120
|
-
tla
|
|
133
|
+
tla tlc <spec_name>
|
|
121
134
|
```
|
|
122
135
|
|
|
123
136
|
For example (runs `queue.tla`):
|
|
124
137
|
|
|
125
138
|
```bash
|
|
126
|
-
tla
|
|
139
|
+
tla tlc queue
|
|
127
140
|
```
|
|
128
141
|
|
|
129
|
-
> **Note:** Starting from version `0.
|
|
142
|
+
> **Note:** Starting from version `0.3.0`, the command structure has changed. To run a model, use `tla tlc <spec>`. For version `0.2.x`, the command was `tla run <spec>`. Since `0.3.0`, management commands are under `tla tools`.
|
|
130
143
|
|
|
131
144
|
### Compile Custom Java Modules
|
|
132
145
|
|
|
133
|
-
Note that modules are compiled using the pinned version of
|
|
146
|
+
Note that modules are compiled using the pinned version of the toolset.
|
|
134
147
|
|
|
135
148
|
Compile modules:
|
|
136
149
|
```bash
|
|
@@ -196,7 +209,7 @@ java:
|
|
|
196
209
|
| Directory | Purpose | Location |
|
|
197
210
|
|---|---|---|
|
|
198
211
|
| Config | `config.yaml` | `~/.config/tla/` |
|
|
199
|
-
|
|
|
212
|
+
| Toolset Versions | Version dirs & `tools-pinned-version.txt` file | `~/.cache/tla/tools/` |
|
|
200
213
|
| API Cache | `github_cache.json` | `~/.cache/tla/` |
|
|
201
214
|
| Workspace | specs + modules + classes | Set via `workspace.root` in config |
|
|
202
215
|
|
|
@@ -22,87 +22,99 @@ uv tool uninstall tlaplus-cli
|
|
|
22
22
|
|
|
23
23
|
## Usage
|
|
24
24
|
|
|
25
|
-
### Managing
|
|
25
|
+
### Managing TLA+ Tools
|
|
26
26
|
|
|
27
|
-
The `tla
|
|
27
|
+
The `tla tools` command group allows you to download and manage multiple versions of the TLA+ toolset (TLC, SANY, TLATeX) directly from GitHub releases.
|
|
28
28
|
|
|
29
|
-
List available and installed
|
|
29
|
+
List available and installed toolset versions:
|
|
30
30
|
```bash
|
|
31
|
-
tla
|
|
31
|
+
tla tools list
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
Install the latest
|
|
34
|
+
Install the latest toolset version:
|
|
35
35
|
```bash
|
|
36
|
-
tla
|
|
36
|
+
tla tools install
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
> [!TIP]
|
|
40
|
+
> The first version you install is automatically "pinned" as the default. Subsequent installs won't change your pin unless you manually use `tla tools pin`.
|
|
41
|
+
|
|
42
|
+
Install a specific toolset version:
|
|
40
43
|
```bash
|
|
41
|
-
tla
|
|
44
|
+
tla tools install v1.8.0
|
|
42
45
|
```
|
|
43
46
|
|
|
44
47
|
Pin a specific version to be used by default:
|
|
45
48
|
```bash
|
|
46
|
-
tla
|
|
49
|
+
tla tools pin v1.8.0
|
|
47
50
|
```
|
|
48
51
|
|
|
49
52
|
Upgrade the pinned version (or a specific version) to a newer commit:
|
|
50
53
|
```bash
|
|
51
|
-
tla
|
|
54
|
+
tla tools upgrade
|
|
52
55
|
```
|
|
53
56
|
|
|
57
|
+
> [!NOTE]
|
|
58
|
+
> If the target version to upgrade is not yet installed locally, the CLI will automatically download it.
|
|
59
|
+
|
|
54
60
|
Show the TLC2 version string and absolute path to the pinned version's `tla2tools.jar`:
|
|
55
61
|
```bash
|
|
56
|
-
tla
|
|
62
|
+
tla tools path
|
|
57
63
|
```
|
|
58
64
|
|
|
59
65
|
Or for a specific version:
|
|
60
66
|
```bash
|
|
61
|
-
tla
|
|
67
|
+
tla tools path v1.8.0
|
|
62
68
|
```
|
|
63
69
|
|
|
64
70
|
Example output:
|
|
65
71
|
```text
|
|
66
72
|
TLC2 Version 2.19 of 08 August 2024 (rev: 5a47802)
|
|
67
|
-
/home/bob/.cache/tla/
|
|
73
|
+
/home/bob/.cache/tla/tools/v1.8.0-5a47802/tla2tools.jar
|
|
68
74
|
```
|
|
69
75
|
|
|
70
|
-
Show the
|
|
76
|
+
Show the toolset versions directory and all installed version directories:
|
|
71
77
|
```bash
|
|
72
|
-
tla
|
|
78
|
+
tla tools dir
|
|
73
79
|
```
|
|
74
80
|
|
|
75
81
|
Example output:
|
|
76
82
|
```text
|
|
77
|
-
/home/bob/.cache/tla/
|
|
83
|
+
/home/bob/.cache/tla/tools
|
|
78
84
|
v1.7.0-abc1234
|
|
79
85
|
v1.8.0-5a47802
|
|
80
86
|
```
|
|
81
87
|
|
|
82
88
|
Uninstall a specific version (or use 'default' to remove legacy jars):
|
|
83
89
|
```bash
|
|
84
|
-
tla
|
|
90
|
+
tla tools uninstall v1.8.0
|
|
85
91
|
```
|
|
86
92
|
|
|
93
|
+
> [!TIP]
|
|
94
|
+
> Use `--all` to remove all installed tags for a specific version name without interactive prompts.
|
|
95
|
+
|
|
96
|
+
> [!NOTE]
|
|
97
|
+
> If you uninstall the currently pinned version, the CLI will automatically "fall back" to the next best installed version (ranked by semver, then release date).
|
|
98
|
+
|
|
87
99
|
### Run TLC
|
|
88
100
|
|
|
89
|
-
Run the TLC model checker on a specification. This uses the currently pinned
|
|
101
|
+
Run the TLC model checker on a specification. This uses the currently pinned toolset version.
|
|
90
102
|
|
|
91
103
|
```bash
|
|
92
|
-
tla
|
|
104
|
+
tla tlc <spec_name>
|
|
93
105
|
```
|
|
94
106
|
|
|
95
107
|
For example (runs `queue.tla`):
|
|
96
108
|
|
|
97
109
|
```bash
|
|
98
|
-
tla
|
|
110
|
+
tla tlc queue
|
|
99
111
|
```
|
|
100
112
|
|
|
101
|
-
> **Note:** Starting from version `0.
|
|
113
|
+
> **Note:** Starting from version `0.3.0`, the command structure has changed. To run a model, use `tla tlc <spec>`. For version `0.2.x`, the command was `tla run <spec>`. Since `0.3.0`, management commands are under `tla tools`.
|
|
102
114
|
|
|
103
115
|
### Compile Custom Java Modules
|
|
104
116
|
|
|
105
|
-
Note that modules are compiled using the pinned version of
|
|
117
|
+
Note that modules are compiled using the pinned version of the toolset.
|
|
106
118
|
|
|
107
119
|
Compile modules:
|
|
108
120
|
```bash
|
|
@@ -168,7 +180,7 @@ java:
|
|
|
168
180
|
| Directory | Purpose | Location |
|
|
169
181
|
|---|---|---|
|
|
170
182
|
| Config | `config.yaml` | `~/.config/tla/` |
|
|
171
|
-
|
|
|
183
|
+
| Toolset Versions | Version dirs & `tools-pinned-version.txt` file | `~/.cache/tla/tools/` |
|
|
172
184
|
| API Cache | `github_cache.json` | `~/.cache/tla/` |
|
|
173
185
|
| Workspace | specs + modules + classes | Set via `workspace.root` in config |
|
|
174
186
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "tlaplus-cli"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.3.1"
|
|
8
8
|
description = "TLA+ tools: download TLC, compile custom modules, run model checker"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.11"
|
|
@@ -14,6 +14,7 @@ dependencies = [
|
|
|
14
14
|
"pyyaml>=6.0,<7.0",
|
|
15
15
|
"platformdirs>=4.0,<5.0",
|
|
16
16
|
"pydantic>=2.12.5,<3.0.0",
|
|
17
|
+
"truststore>=0.9.0,<1.0.0",
|
|
17
18
|
]
|
|
18
19
|
authors = [
|
|
19
20
|
{name = "Denis Nikolskiy", email = "codeomatics@gmail.com"}
|
|
@@ -8,11 +8,11 @@ from tlaplus_cli.build_tlc_module import build as build_tlc_cmd
|
|
|
8
8
|
from tlaplus_cli.check_java import check_java_version, get_java_version
|
|
9
9
|
from tlaplus_cli.config import load_config
|
|
10
10
|
from tlaplus_cli.run_tlc import tlc as run_tlc_cmd
|
|
11
|
-
from tlaplus_cli.
|
|
11
|
+
from tlaplus_cli.tools_manager import fetch_cache_app, tools_app
|
|
12
12
|
|
|
13
13
|
app = typer.Typer(
|
|
14
14
|
name="tla",
|
|
15
|
-
help="TLA+ tools: download
|
|
15
|
+
help="TLA+ tools: download TLA+ toolset distribution, compile custom modules, run model checker.",
|
|
16
16
|
no_args_is_help=True,
|
|
17
17
|
add_completion=False,
|
|
18
18
|
)
|
|
@@ -47,11 +47,11 @@ def root(
|
|
|
47
47
|
|
|
48
48
|
# --- Subcommands ---
|
|
49
49
|
|
|
50
|
-
# Attach typer subgroups for
|
|
51
|
-
app.add_typer(
|
|
50
|
+
# Attach typer subgroups for tools and fetch-cache
|
|
51
|
+
app.add_typer(tools_app, name="tools")
|
|
52
52
|
app.add_typer(fetch_cache_app, name="fetch-cache")
|
|
53
53
|
|
|
54
|
-
app.command(name="
|
|
54
|
+
app.command(name="tlc")(run_tlc_cmd)
|
|
55
55
|
app.command(name="build")(build_tlc_cmd)
|
|
56
56
|
|
|
57
57
|
|
|
@@ -21,7 +21,7 @@ def version_callback(value: bool) -> None:
|
|
|
21
21
|
|
|
22
22
|
if not jar_path.exists():
|
|
23
23
|
typer.echo(f"Error: tla2tools.jar not found at {jar_path}", err=True)
|
|
24
|
-
typer.echo("Run 'tla
|
|
24
|
+
typer.echo("Run 'tla tools install' first.", err=True)
|
|
25
25
|
raise typer.Exit(1)
|
|
26
26
|
|
|
27
27
|
cmd = ["java", "-cp", str(jar_path), config.tlc.java_class]
|
|
@@ -63,7 +63,7 @@ def tlc(
|
|
|
63
63
|
|
|
64
64
|
if not jar_path.exists():
|
|
65
65
|
typer.echo("Error: tla2tools.jar not found.", err=True)
|
|
66
|
-
typer.echo("Run 'tla
|
|
66
|
+
typer.echo("Run 'tla tools install' first.", err=True)
|
|
67
67
|
raise typer.Exit(1)
|
|
68
68
|
|
|
69
69
|
ws_root = workspace_root()
|