labcode 0.1.1__tar.gz → 0.1.2__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.
- {labcode-0.1.1 → labcode-0.1.2}/PKG-INFO +3 -3
- {labcode-0.1.1 → labcode-0.1.2}/labcode/run_cli.py +6 -6
- {labcode-0.1.1 → labcode-0.1.2}/labcode.egg-info/PKG-INFO +3 -3
- {labcode-0.1.1 → labcode-0.1.2}/labcode.egg-info/requires.txt +2 -2
- {labcode-0.1.1 → labcode-0.1.2}/labcode.egg-info/scm_version.json +2 -2
- {labcode-0.1.1 → labcode-0.1.2}/pyproject.toml +2 -2
- {labcode-0.1.1 → labcode-0.1.2}/tests/test_run_cli.py +36 -0
- {labcode-0.1.1 → labcode-0.1.2}/.github/workflows/ci.yml +0 -0
- {labcode-0.1.1 → labcode-0.1.2}/.github/workflows/publish.yml +0 -0
- {labcode-0.1.1 → labcode-0.1.2}/.gitignore +0 -0
- {labcode-0.1.1 → labcode-0.1.2}/LICENSE +0 -0
- {labcode-0.1.1 → labcode-0.1.2}/README.md +0 -0
- {labcode-0.1.1 → labcode-0.1.2}/SPECIFICATIONS.md +0 -0
- {labcode-0.1.1 → labcode-0.1.2}/examples/README.md +0 -0
- {labcode-0.1.1 → labcode-0.1.2}/examples/outputs/plate_line.boundary.yaml +0 -0
- {labcode-0.1.1 → labcode-0.1.2}/examples/outputs/plate_line.observation.yaml +0 -0
- {labcode-0.1.1 → labcode-0.1.2}/examples/outputs/plate_line.plan.yaml +0 -0
- {labcode-0.1.1 → labcode-0.1.2}/examples/outputs/plate_line.svg +0 -0
- {labcode-0.1.1 → labcode-0.1.2}/examples/plate_line.boundary.yaml +0 -0
- {labcode-0.1.1 → labcode-0.1.2}/examples/plate_line.env.yaml +0 -0
- {labcode-0.1.1 → labcode-0.1.2}/examples/plate_line.workflow.yaml +0 -0
- {labcode-0.1.1 → labcode-0.1.2}/examples/render_plate_line.py +0 -0
- {labcode-0.1.1 → labcode-0.1.2}/labcode/__init__.py +0 -0
- {labcode-0.1.1 → labcode-0.1.2}/labcode/__main__.py +0 -0
- {labcode-0.1.1 → labcode-0.1.2}/labcode/_child.py +0 -0
- {labcode-0.1.1 → labcode-0.1.2}/labcode/backend.py +0 -0
- {labcode-0.1.1 → labcode-0.1.2}/labcode/cli.py +0 -0
- {labcode-0.1.1 → labcode-0.1.2}/labcode/dialect.py +0 -0
- {labcode-0.1.1 → labcode-0.1.2}/labcode/idgen.py +0 -0
- {labcode-0.1.1 → labcode-0.1.2}/labcode/objectid.py +0 -0
- {labcode-0.1.1 → labcode-0.1.2}/labcode/py.typed +0 -0
- {labcode-0.1.1 → labcode-0.1.2}/labcode/runner.py +0 -0
- {labcode-0.1.1 → labcode-0.1.2}/labcode.egg-info/SOURCES.txt +0 -0
- {labcode-0.1.1 → labcode-0.1.2}/labcode.egg-info/dependency_links.txt +0 -0
- {labcode-0.1.1 → labcode-0.1.2}/labcode.egg-info/entry_points.txt +0 -0
- {labcode-0.1.1 → labcode-0.1.2}/labcode.egg-info/scm_file_list.json +0 -0
- {labcode-0.1.1 → labcode-0.1.2}/labcode.egg-info/top_level.txt +0 -0
- {labcode-0.1.1 → labcode-0.1.2}/setup.cfg +0 -0
- {labcode-0.1.1 → labcode-0.1.2}/tests/fixtures/device_script.env.yaml +0 -0
- {labcode-0.1.1 → labcode-0.1.2}/tests/fixtures/device_script.workflow.yaml +0 -0
- {labcode-0.1.1 → labcode-0.1.2}/tests/fixtures/transport.env.yaml +0 -0
- {labcode-0.1.1 → labcode-0.1.2}/tests/fixtures/transport.workflow.yaml +0 -0
- {labcode-0.1.1 → labcode-0.1.2}/tests/test_backend.py +0 -0
- {labcode-0.1.1 → labcode-0.1.2}/tests/test_cli.py +0 -0
- {labcode-0.1.1 → labcode-0.1.2}/tests/test_dialect.py +0 -0
- {labcode-0.1.1 → labcode-0.1.2}/tests/test_objectid.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: labcode
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: labcode -- a dialect wrapper over the Object-Flow Programming Language toolchain
|
|
5
5
|
Author-email: Kazunari Kaizu <kwaizu@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -20,9 +20,9 @@ Classifier: Typing :: Typed
|
|
|
20
20
|
Requires-Python: >=3.10
|
|
21
21
|
Description-Content-Type: text/markdown
|
|
22
22
|
License-File: LICENSE
|
|
23
|
-
Requires-Dist: ofplang-validate>=0.1.
|
|
23
|
+
Requires-Dist: ofplang-validate>=0.1.3
|
|
24
24
|
Requires-Dist: ofplang-schedule>=0.1.3
|
|
25
|
-
Requires-Dist: ofplang-run>=0.1.
|
|
25
|
+
Requires-Dist: ofplang-run>=0.1.10
|
|
26
26
|
Provides-Extra: test
|
|
27
27
|
Requires-Dist: pytest>=7.0; extra == "test"
|
|
28
28
|
Provides-Extra: dev
|
|
@@ -122,14 +122,14 @@ def main(argv: Sequence[str] | None = None) -> int:
|
|
|
122
122
|
|
|
123
123
|
# labcode dialect front door: validate the env x-labcode extension (P5) over the
|
|
124
124
|
# workflow (for (1)/(2) exclusivity) and the environment. Warnings are printed but do
|
|
125
|
-
# not block; errors are a usage error.
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
125
|
+
# not block; errors are a usage error. Use the *expanded* workflow the shared front
|
|
126
|
+
# door already resolved (`fd.document`), so `$import` is applied once, no second read
|
|
127
|
+
# happens, and imported types/ops are visible to the dialect check and `_id` setup.
|
|
128
|
+
workflow_doc = fd.document or {}
|
|
129
129
|
env_doc, err = _read_document(args.env, "environment")
|
|
130
130
|
if err is not None:
|
|
131
131
|
return err
|
|
132
|
-
dialect = validate_dialect(workflow_doc
|
|
132
|
+
dialect = validate_dialect(workflow_doc, env_doc or {})
|
|
133
133
|
for warning in dialect.warnings:
|
|
134
134
|
print(f"lc run: warning: {warning}", file=sys.stderr)
|
|
135
135
|
if not dialect.ok:
|
|
@@ -153,7 +153,7 @@ def main(argv: Sequence[str] | None = None) -> int:
|
|
|
153
153
|
# declare `_id`, mint the boundary's Object ids, share one IdGenerator with the
|
|
154
154
|
# backend); it runs the rewritten document in memory (no temp file).
|
|
155
155
|
result = run_labcode(
|
|
156
|
-
workflow_doc
|
|
156
|
+
workflow_doc,
|
|
157
157
|
args.env,
|
|
158
158
|
boundary,
|
|
159
159
|
running_task_margin=margin,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: labcode
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: labcode -- a dialect wrapper over the Object-Flow Programming Language toolchain
|
|
5
5
|
Author-email: Kazunari Kaizu <kwaizu@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -20,9 +20,9 @@ Classifier: Typing :: Typed
|
|
|
20
20
|
Requires-Python: >=3.10
|
|
21
21
|
Description-Content-Type: text/markdown
|
|
22
22
|
License-File: LICENSE
|
|
23
|
-
Requires-Dist: ofplang-validate>=0.1.
|
|
23
|
+
Requires-Dist: ofplang-validate>=0.1.3
|
|
24
24
|
Requires-Dist: ofplang-schedule>=0.1.3
|
|
25
|
-
Requires-Dist: ofplang-run>=0.1.
|
|
25
|
+
Requires-Dist: ofplang-run>=0.1.10
|
|
26
26
|
Provides-Extra: test
|
|
27
27
|
Requires-Dist: pytest>=7.0; extra == "test"
|
|
28
28
|
Provides-Extra: dev
|
|
@@ -32,9 +32,9 @@ classifiers = [
|
|
|
32
32
|
# support so a described workflow passes the front door (spec 2.7, >=0.1.2). `validate`
|
|
33
33
|
# and `schedule` subcommands still forward unchanged.
|
|
34
34
|
dependencies = [
|
|
35
|
-
"ofplang-validate>=0.1.
|
|
35
|
+
"ofplang-validate>=0.1.3",
|
|
36
36
|
"ofplang-schedule>=0.1.3",
|
|
37
|
-
"ofplang-run>=0.1.
|
|
37
|
+
"ofplang-run>=0.1.10",
|
|
38
38
|
]
|
|
39
39
|
|
|
40
40
|
[project.urls]
|
|
@@ -82,6 +82,42 @@ def test_e2e_lc_run_stamps_deterministic_object_ids(tmp_path):
|
|
|
82
82
|
assert doc1 == yaml.safe_load(rb2.read_text(encoding="utf-8")) # deterministic
|
|
83
83
|
|
|
84
84
|
|
|
85
|
+
def test_e2e_lc_run_expands_imported_object_types_and_stamps_ids(tmp_path):
|
|
86
|
+
# `$import` and `_id` compose: the object types (Plate/Tube) are moved into an
|
|
87
|
+
# imported fragment, so the shared front door must expand it first; then
|
|
88
|
+
# LabcodeRunner injects `_id` into those *imported* object types. The Tube id
|
|
89
|
+
# still round-trips, proving expansion happens before `_id` injection.
|
|
90
|
+
pytest.importorskip("ofplang.schedule", reason="ofplang-schedule not installed")
|
|
91
|
+
import yaml
|
|
92
|
+
|
|
93
|
+
src = (EXAMPLES / "plate_line.workflow.yaml").read_text(encoding="utf-8")
|
|
94
|
+
head, body = src[: src.index("types:")], src[src.index("processes:") :]
|
|
95
|
+
(tmp_path / "plate_types.yaml").write_text(
|
|
96
|
+
"Plate:\n domain: object\n view:\n barcode: { type: String }\n"
|
|
97
|
+
"Tube:\n domain: object\n",
|
|
98
|
+
encoding="utf-8",
|
|
99
|
+
)
|
|
100
|
+
wf = tmp_path / "plate_line.workflow.yaml"
|
|
101
|
+
wf.write_text(head + "types:\n $import: ./plate_types.yaml\n" + body, encoding="utf-8")
|
|
102
|
+
|
|
103
|
+
rb = tmp_path / "rb.yaml"
|
|
104
|
+
code = run_cli.main(
|
|
105
|
+
[
|
|
106
|
+
str(wf),
|
|
107
|
+
"--env", str(EXAMPLES / "plate_line.env.yaml"),
|
|
108
|
+
"--boundary", str(EXAMPLES / "plate_line.boundary.yaml"),
|
|
109
|
+
"--seconds-per-tick", "0.001",
|
|
110
|
+
"-o", str(tmp_path / "status.yaml"),
|
|
111
|
+
"--boundary-out", str(rb),
|
|
112
|
+
]
|
|
113
|
+
)
|
|
114
|
+
assert code == 0
|
|
115
|
+
doc = yaml.safe_load(rb.read_text(encoding="utf-8"))
|
|
116
|
+
out_tube = doc["boundary"]["outputs"]["tube"]["view"]
|
|
117
|
+
in_tube = doc["boundary"]["inputs"]["tube"]["view"]
|
|
118
|
+
assert out_tube["_id"] and out_tube["_id"] == in_tube["_id"]
|
|
119
|
+
|
|
120
|
+
|
|
85
121
|
def test_cli_dialect_error_is_a_usage_error(tmp_path, capsys):
|
|
86
122
|
# A non-python x-labcode script is rejected at the dialect front door (exit 2), before
|
|
87
123
|
# any execution.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|