参考所有分组,完成尽量多的内容:结论为 binding manifest 纳入 source-map 守护

This commit is contained in:
cnc
2026-06-03 23:39:09 +08:00
parent 0a270c73a0
commit 708b2bee17

View File

@@ -824,20 +824,40 @@ manifest_core = [
for line in Path("linuxcnc-rs274-source-files.txt").read_text(encoding="utf-8").splitlines() for line in Path("linuxcnc-rs274-source-files.txt").read_text(encoding="utf-8").splitlines()
if line.startswith("core:") if line.startswith("core:")
] ]
manifest_bindings = [
Path(line.split(":", 2)[1]).name
for line in Path("linuxcnc-rs274-source-files.txt").read_text(encoding="utf-8").splitlines()
if line.startswith("binding:")
]
source_map_core = [] source_map_core = []
source_map_bindings = []
in_core_section = False in_core_section = False
in_binding_section = False
for line in source_map.splitlines(): for line in source_map.splitlines():
if line == "### Interpreter core": if line == "### Interpreter core":
in_core_section = True in_core_section = True
in_binding_section = False
continue
if line == "### Python binding modules":
in_core_section = False
in_binding_section = True
continue continue
if in_core_section and line.startswith("### "): if in_core_section and line.startswith("### "):
break break
if in_binding_section and line.startswith("### "):
in_binding_section = False
if in_core_section and line.startswith("- `"): if in_core_section and line.startswith("- `"):
source_map_core.append(line.split("`", 2)[1]) source_map_core.append(line.split("`", 2)[1])
if in_binding_section and line.startswith("- `"):
source_map_bindings.append(line.split("`", 2)[1])
if source_map_core != manifest_core: if source_map_core != manifest_core:
raise SystemExit( raise SystemExit(
"docs/linuxcnc-rs274-source-map.md interpreter core list no longer matches linuxcnc-rs274-source-files.txt core manifest" "docs/linuxcnc-rs274-source-map.md interpreter core list no longer matches linuxcnc-rs274-source-files.txt core manifest"
) )
if source_map_bindings != manifest_bindings:
raise SystemExit(
"docs/linuxcnc-rs274-source-map.md Python binding module list no longer matches linuxcnc-rs274-source-files.txt binding manifest"
)
PY PY
for script in \ for script in \