scjson 0.3.2__tar.gz → 0.3.4__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.
- {scjson-0.3.2/scjson.egg-info → scjson-0.3.4}/PKG-INFO +54 -3
- {scjson-0.3.2 → scjson-0.3.4}/README.md +49 -2
- scjson-0.3.4/exec_compare.py +687 -0
- scjson-0.3.4/exec_sweep.py +439 -0
- scjson-0.3.4/pyproject.toml +33 -0
- {scjson-0.3.2 → scjson-0.3.4}/scjson/activation.py +2 -0
- scjson-0.3.4/scjson/cli.py +664 -0
- scjson-0.3.4/scjson/context.py +2340 -0
- scjson-0.3.4/scjson/engine.py +26 -0
- {scjson-0.3.2 → scjson-0.3.4}/scjson/events.py +36 -0
- scjson-0.3.4/scjson/invoke.py +567 -0
- scjson-0.3.4/scjson/jinja_gen.py +801 -0
- scjson-0.3.4/scjson/safe_eval.py +255 -0
- {scjson-0.3.2 → scjson-0.3.4/scjson.egg-info}/PKG-INFO +54 -3
- scjson-0.3.4/scjson.egg-info/SOURCES.txt +55 -0
- scjson-0.3.4/scjson.egg-info/entry_points.txt +5 -0
- scjson-0.3.4/scjson.egg-info/requires.txt +8 -0
- scjson-0.3.4/scjson.egg-info/top_level.txt +4 -0
- scjson-0.3.4/tests/__pycache__/test_cli.cpython-311-pytest-8.4.1.pyc +0 -0
- scjson-0.3.4/tests/__pycache__/test_engine.cpython-311-pytest-8.4.1.pyc +0 -0
- scjson-0.3.4/tests/__pycache__/test_engine_cli.cpython-311-pytest-8.4.1.pyc +0 -0
- scjson-0.3.4/tests/__pycache__/test_exec_compare_advanced.cpython-311-pytest-8.4.1.pyc +0 -0
- scjson-0.3.4/tests/__pycache__/test_exec_compare_integration.cpython-311-pytest-8.4.1.pyc +0 -0
- scjson-0.3.4/tests/__pycache__/test_exec_sweep_corpus.cpython-311-pytest-8.4.1.pyc +0 -0
- scjson-0.3.4/tests/__pycache__/test_exec_sweep_integration.cpython-311-pytest-8.4.1.pyc +0 -0
- scjson-0.3.4/tests/__pycache__/test_json_stream.cpython-311-pytest-8.4.1.pyc +0 -0
- scjson-0.3.4/tests/__pycache__/test_safe_eval.cpython-311-pytest-8.4.1.pyc +0 -0
- scjson-0.3.4/tests/__pycache__/test_vector_analyzer.cpython-311-pytest-8.4.1.pyc +0 -0
- scjson-0.3.4/tests/__pycache__/test_vector_coverage.cpython-311-pytest-8.4.1.pyc +0 -0
- scjson-0.3.4/tests/__pycache__/test_vector_gen.cpython-311-pytest-8.4.1.pyc +0 -0
- scjson-0.3.4/tests/__pycache__/test_vector_invoke.cpython-311-pytest-8.4.1.pyc +0 -0
- scjson-0.3.4/tests/__pycache__/test_vector_search.cpython-311-pytest-8.4.1.pyc +0 -0
- scjson-0.3.4/tests/test_engine.py +1471 -0
- scjson-0.3.4/tests/test_engine_cli.py +86 -0
- scjson-0.3.4/tests/test_exec_compare_advanced.py +237 -0
- scjson-0.3.4/tests/test_exec_compare_integration.py +85 -0
- scjson-0.3.4/tests/test_exec_sweep_corpus.py +57 -0
- scjson-0.3.4/tests/test_exec_sweep_integration.py +64 -0
- scjson-0.3.4/tests/test_safe_eval.py +54 -0
- scjson-0.3.4/tests/test_vector_analyzer.py +60 -0
- scjson-0.3.4/tests/test_vector_coverage.py +39 -0
- scjson-0.3.4/tests/test_vector_gen.py +300 -0
- scjson-0.3.4/tests/test_vector_invoke.py +53 -0
- scjson-0.3.4/tests/test_vector_search.py +53 -0
- scjson-0.3.4/vector_gen.py +330 -0
- scjson-0.3.2/pyproject.toml +0 -20
- scjson-0.3.2/scjson/cli.py +0 -310
- scjson-0.3.2/scjson/context.py +0 -330
- scjson-0.3.2/scjson/dataclasses/__init__.py +0 -121
- scjson-0.3.2/scjson/dataclasses/generated.py +0 -1754
- scjson-0.3.2/scjson/dataclasses_strict/__init__.py +0 -121
- scjson-0.3.2/scjson/dataclasses_strict/generated.py +0 -1761
- scjson-0.3.2/scjson/engine.py +0 -170
- scjson-0.3.2/scjson/jinja_gen.py +0 -344
- scjson-0.3.2/scjson/pydantic/__init__.py +0 -121
- scjson-0.3.2/scjson/pydantic/generated.py +0 -1185
- scjson-0.3.2/scjson/pydantic_strict/__init__.py +0 -121
- scjson-0.3.2/scjson/pydantic_strict/generated.py +0 -1188
- scjson-0.3.2/scjson.egg-info/SOURCES.txt +0 -34
- scjson-0.3.2/scjson.egg-info/entry_points.txt +0 -2
- scjson-0.3.2/scjson.egg-info/requires.txt +0 -4
- scjson-0.3.2/scjson.egg-info/top_level.txt +0 -1
- scjson-0.3.2/tests/__pycache__/test_cli.cpython-310-pytest-8.4.1.pyc +0 -0
- scjson-0.3.2/tests/test_engine.py +0 -279
- {scjson-0.3.2 → scjson-0.3.4}/LEGAL.md +0 -0
- {scjson-0.3.2 → scjson-0.3.4}/LICENSE +0 -0
- {scjson-0.3.2 → scjson-0.3.4}/MANIFEST.in +0 -0
- {scjson-0.3.2 → scjson-0.3.4}/scjson/CaseStyle.py +0 -0
- {scjson-0.3.2 → scjson-0.3.4}/scjson/SCXMLDocumentHandler.py +0 -0
- {scjson-0.3.2 → scjson-0.3.4}/scjson/__init__.py +0 -0
- {scjson-0.3.2 → scjson-0.3.4}/scjson/__main__.py +0 -0
- {scjson-0.3.2 → scjson-0.3.4}/scjson/json_stream.py +0 -0
- {scjson-0.3.2 → scjson-0.3.4}/scjson.egg-info/dependency_links.txt +0 -0
- {scjson-0.3.2 → scjson-0.3.4}/setup.cfg +0 -0
- {scjson-0.3.2 → scjson-0.3.4}/tests/test_cli.py +0 -0
- {scjson-0.3.2 → scjson-0.3.4}/tests/test_json_stream.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: scjson
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.4
|
|
4
4
|
Summary: A JSON-based serialization of SCXML (State Chart XML) for modern tooling, interoperability, and education.
|
|
5
5
|
Author-email: Ira Abbott <ira@mycloud.blue>
|
|
6
6
|
License-Expression: BSD-1-Clause
|
|
@@ -11,8 +11,14 @@ Requires-Dist: pydantic
|
|
|
11
11
|
Requires-Dist: lxml
|
|
12
12
|
Requires-Dist: jsonschema
|
|
13
13
|
Requires-Dist: click
|
|
14
|
+
Requires-Dist: py-sandboxed
|
|
15
|
+
Requires-Dist: jinja2
|
|
16
|
+
Requires-Dist: xmlschema
|
|
17
|
+
Requires-Dist: xsdata
|
|
14
18
|
Dynamic: license-file
|
|
15
19
|
|
|
20
|
+
<p align="center"><img src="https://raw.githubusercontent.com/SoftOboros/scjson/main/scjson.png" alt="scjson logo" width="200"/></p>
|
|
21
|
+
|
|
16
22
|
# scjson Python Package
|
|
17
23
|
|
|
18
24
|
This directory contains the Python implementation of **scjson**, a format for representing SCXML state machines in JSON. The package provides a command line interface and utility functions to convert between `.scxml` and `.scjson` files and to validate documents against the project's schema.
|
|
@@ -46,6 +52,32 @@ cd py && pip install -e .
|
|
|
46
52
|
- rust
|
|
47
53
|
- swift
|
|
48
54
|
|
|
55
|
+
## Python Engine — User Guide
|
|
56
|
+
|
|
57
|
+
For end‑to‑end usage of the Python execution engine (tracing, comparing against a reference, generating vectors, sweeping corpora), see:
|
|
58
|
+
|
|
59
|
+
- docs/ENGINE-PY.md (in this repository)
|
|
60
|
+
|
|
61
|
+
Online: https://github.com/SoftOboros/scjson/blob/main/docs/ENGINE-PY.md
|
|
62
|
+
|
|
63
|
+
## SCION Reference Dependency
|
|
64
|
+
|
|
65
|
+
Several comparison tests (`py/tests/test_exec_compare_advanced.py`) and the
|
|
66
|
+
`exec_compare` tooling invoke the Node-based [SCION](https://www.npmjs.com/package/scion) runner bundled under
|
|
67
|
+
`tools/scion-runner`. Node.js must be able to resolve the [SCION](https://www.npmjs.com/package/scion) packages
|
|
68
|
+
(`scxml`, `jsdom`, and `regenerator-runtime`) via its module loader. Install
|
|
69
|
+
them once before running comparisons:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
cd tools/scion-runner
|
|
73
|
+
npm ci # or npm install
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
When running the Python tests or CLI comparisons, ensure `node` can load these
|
|
77
|
+
modules (for example by keeping the installation above in place or by adding
|
|
78
|
+
their location to `NODE_PATH`). Without the [SCION](https://www.npmjs.com/package/scion) packages, comparisons fall
|
|
79
|
+
back to the Python engine.
|
|
80
|
+
|
|
49
81
|
## Command Line Usage
|
|
50
82
|
|
|
51
83
|
After installation the `scjson` command is available:
|
|
@@ -133,6 +165,26 @@ Operational conformance testing is performed via [uber_test.py](https://github.c
|
|
|
133
165
|
```
|
|
134
166
|
Note: [uber_test.py](https://github.com/SoftOboros/scjson/blob/main/py/uber_test.py) applies all scxml files in [Zhornyak's ScxmlEditor-Tutorial](https://alexzhornyak.github.io/ScxmlEditor-Tutorial/) which provides a robest set of scxml test vectors useful for standard compliance verification. This is the only file in the test suite which fails to verify round-trip.
|
|
135
167
|
|
|
168
|
+
### Uber Test Harness
|
|
169
|
+
|
|
170
|
+
Run across all languages or a single language with alias support:
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
# All languages detected on PATH
|
|
174
|
+
python py/uber_test.py
|
|
175
|
+
|
|
176
|
+
# Single language (aliases allowed): py, python, js, ts, javascript, rs, rust, swift, java, csharp
|
|
177
|
+
python py/uber_test.py -l js
|
|
178
|
+
python py/uber_test.py -l swfit # typo tolerated → swift
|
|
179
|
+
|
|
180
|
+
# Limit the corpus and treat consensus as warnings only
|
|
181
|
+
python py/uber_test.py -l swift -s "Examples/Qt/StopWatch/*.scxml" --consensus-warn
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
- `-s/--subset` filters SCXML files by a glob relative to `tutorial/`.
|
|
185
|
+
- `--consensus-warn` downgrades mismatches to warnings when reference languages (Python/JavaScript/Rust) match the canonical structure.
|
|
186
|
+
- The harness normalizes structural differences (see INFERENCE.md) to produce actionable diffs and prints a triage line with a recommendation.
|
|
187
|
+
|
|
136
188
|
## Model Variants
|
|
137
189
|
|
|
138
190
|
The Python package exposes four sets of generated models that mirror the
|
|
@@ -238,5 +290,4 @@ docker pull iraa/scjson:latest
|
|
|
238
290
|
|
|
239
291
|
## License
|
|
240
292
|
|
|
241
|
-
All source code in this directory is released under the BSD
|
|
242
|
-
|
|
293
|
+
All source code in this directory is released under the BSD 1-Clause license. See [LICENSE](./LICENSE) and [LEGAL.md](./LEGAL.md) for details.
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
<p align="center"><img src="https://raw.githubusercontent.com/SoftOboros/scjson/main/scjson.png" alt="scjson logo" width="200"/></p>
|
|
2
|
+
|
|
1
3
|
# scjson Python Package
|
|
2
4
|
|
|
3
5
|
This directory contains the Python implementation of **scjson**, a format for representing SCXML state machines in JSON. The package provides a command line interface and utility functions to convert between `.scxml` and `.scjson` files and to validate documents against the project's schema.
|
|
@@ -31,6 +33,32 @@ cd py && pip install -e .
|
|
|
31
33
|
- rust
|
|
32
34
|
- swift
|
|
33
35
|
|
|
36
|
+
## Python Engine — User Guide
|
|
37
|
+
|
|
38
|
+
For end‑to‑end usage of the Python execution engine (tracing, comparing against a reference, generating vectors, sweeping corpora), see:
|
|
39
|
+
|
|
40
|
+
- docs/ENGINE-PY.md (in this repository)
|
|
41
|
+
|
|
42
|
+
Online: https://github.com/SoftOboros/scjson/blob/main/docs/ENGINE-PY.md
|
|
43
|
+
|
|
44
|
+
## SCION Reference Dependency
|
|
45
|
+
|
|
46
|
+
Several comparison tests (`py/tests/test_exec_compare_advanced.py`) and the
|
|
47
|
+
`exec_compare` tooling invoke the Node-based [SCION](https://www.npmjs.com/package/scion) runner bundled under
|
|
48
|
+
`tools/scion-runner`. Node.js must be able to resolve the [SCION](https://www.npmjs.com/package/scion) packages
|
|
49
|
+
(`scxml`, `jsdom`, and `regenerator-runtime`) via its module loader. Install
|
|
50
|
+
them once before running comparisons:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
cd tools/scion-runner
|
|
54
|
+
npm ci # or npm install
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
When running the Python tests or CLI comparisons, ensure `node` can load these
|
|
58
|
+
modules (for example by keeping the installation above in place or by adding
|
|
59
|
+
their location to `NODE_PATH`). Without the [SCION](https://www.npmjs.com/package/scion) packages, comparisons fall
|
|
60
|
+
back to the Python engine.
|
|
61
|
+
|
|
34
62
|
## Command Line Usage
|
|
35
63
|
|
|
36
64
|
After installation the `scjson` command is available:
|
|
@@ -118,6 +146,26 @@ Operational conformance testing is performed via [uber_test.py](https://github.c
|
|
|
118
146
|
```
|
|
119
147
|
Note: [uber_test.py](https://github.com/SoftOboros/scjson/blob/main/py/uber_test.py) applies all scxml files in [Zhornyak's ScxmlEditor-Tutorial](https://alexzhornyak.github.io/ScxmlEditor-Tutorial/) which provides a robest set of scxml test vectors useful for standard compliance verification. This is the only file in the test suite which fails to verify round-trip.
|
|
120
148
|
|
|
149
|
+
### Uber Test Harness
|
|
150
|
+
|
|
151
|
+
Run across all languages or a single language with alias support:
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
# All languages detected on PATH
|
|
155
|
+
python py/uber_test.py
|
|
156
|
+
|
|
157
|
+
# Single language (aliases allowed): py, python, js, ts, javascript, rs, rust, swift, java, csharp
|
|
158
|
+
python py/uber_test.py -l js
|
|
159
|
+
python py/uber_test.py -l swfit # typo tolerated → swift
|
|
160
|
+
|
|
161
|
+
# Limit the corpus and treat consensus as warnings only
|
|
162
|
+
python py/uber_test.py -l swift -s "Examples/Qt/StopWatch/*.scxml" --consensus-warn
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
- `-s/--subset` filters SCXML files by a glob relative to `tutorial/`.
|
|
166
|
+
- `--consensus-warn` downgrades mismatches to warnings when reference languages (Python/JavaScript/Rust) match the canonical structure.
|
|
167
|
+
- The harness normalizes structural differences (see INFERENCE.md) to produce actionable diffs and prints a triage line with a recommendation.
|
|
168
|
+
|
|
121
169
|
## Model Variants
|
|
122
170
|
|
|
123
171
|
The Python package exposes four sets of generated models that mirror the
|
|
@@ -223,5 +271,4 @@ docker pull iraa/scjson:latest
|
|
|
223
271
|
|
|
224
272
|
## License
|
|
225
273
|
|
|
226
|
-
All source code in this directory is released under the BSD
|
|
227
|
-
|
|
274
|
+
All source code in this directory is released under the BSD 1-Clause license. See [LICENSE](./LICENSE) and [LEGAL.md](./LEGAL.md) for details.
|