|
|
@@ -243,34 +243,41 @@ def cmd_check(c):
|
|
|
row("版本管理与卸载入口", False, f"{type(_e).__name__}: {_e}")
|
|
|
# 交付文档三件在位(2026-09-22 用户令「需求分析/设计说明/数据要求说明」): 文档名里带**当前版本号**,
|
|
|
# 所以升一次版本号, 旧文档名就过期了 —— 不发 FAIL 的话, 包会悄悄带着 v2.9.2 名字的文档进 v2.10.0 交付。
|
|
|
- # 判据: ① 三份 docx 在位且文件名含当前 VERSION; ② markdown 源件与插图都在位(可重跑重建)。
|
|
|
+ # ★2026-09-22 用户令:「三份 docx 不同步到远端服务器」⇒ 交付部署可以不携带这批文档。
|
|
|
+ # 判据先看 `docs/src` 在不在: 不在 = 本机是**不随文档的部署**(远端演示机就是这种), 只报提示行、不 FAIL,
|
|
|
+ # 且在 import python-docx **之前**分流 —— 那台机没装 docx 依赖, 直接进渲染器会炸成 ModuleNotFoundError。
|
|
|
try:
|
|
|
- import importlib.util as _ilu4
|
|
|
- _sp4 = _ilu4.spec_from_file_location('_ddb', ROOT / "scripts" / "delivery_docs_build.py")
|
|
|
- _ddb = _ilu4.module_from_spec(_sp4)
|
|
|
- _sp4.loader.exec_module(_ddb)
|
|
|
- _V2 = _ddb.VERSION
|
|
|
- _miss, _stale, _figmiss = [], [], []
|
|
|
- for _k, _spec in _ddb.DOCS.items():
|
|
|
- _out = ROOT / _spec['out'].format(v=_V2)
|
|
|
- _src = ROOT / _spec['src'].format(v=_V2)
|
|
|
- if not _out.is_file():
|
|
|
- _miss.append(_out.name)
|
|
|
- _old = sorted((ROOT / "docs").glob(_spec['out'].format(v='*').split('/')[-1]))
|
|
|
- _stale += [p.name for p in _old if p.name != _out.name]
|
|
|
- if not _src.is_file():
|
|
|
- _miss.append(_src.name)
|
|
|
- continue
|
|
|
- for _rel in re.findall(r'!\[[^\]]*\]\((figures/[^)]+)\)', _src.read_text(encoding='utf-8')):
|
|
|
- if not (ROOT / "docs" / _rel).is_file():
|
|
|
- _figmiss.append(_rel)
|
|
|
- _miss += _figmiss
|
|
|
- _ok4 = not _miss
|
|
|
- row(f"交付文档三件 (需求分析/设计说明/数据要求说明 · v{_V2})", _ok4,
|
|
|
- ("3/3 份在位, 文档名含当前版本号, 插图全在位" if _ok4 else
|
|
|
- f"缺 {len(_miss)} 件: {', '.join(_miss[:3])}"
|
|
|
- + (f";同名旧版残留: {', '.join(_stale[:3])}" if _stale else '')
|
|
|
- + " —— 跑 python scripts/delivery_docs_build.py 重建"))
|
|
|
+ if not (ROOT / "docs" / "src").is_dir():
|
|
|
+ row("交付文档三件 (需求分析/设计说明/数据要求说明)", True,
|
|
|
+ "本机未部署交付文档(docs/src 不在位, 按部署口径跳过;需要时跑 "
|
|
|
+ "python scripts/delivery_docs_build.py 重建, 依赖 python-docx)")
|
|
|
+ else:
|
|
|
+ import importlib.util as _ilu4
|
|
|
+ _sp4 = _ilu4.spec_from_file_location('_ddb', ROOT / "scripts" / "delivery_docs_build.py")
|
|
|
+ _ddb = _ilu4.module_from_spec(_sp4)
|
|
|
+ _sp4.loader.exec_module(_ddb)
|
|
|
+ _V2 = _ddb.VERSION
|
|
|
+ _miss, _stale, _figmiss = [], [], []
|
|
|
+ for _k, _spec in _ddb.DOCS.items():
|
|
|
+ _out = ROOT / _spec['out'].format(v=_V2)
|
|
|
+ _src = ROOT / _spec['src'].format(v=_V2)
|
|
|
+ if not _out.is_file():
|
|
|
+ _miss.append(_out.name)
|
|
|
+ _old = sorted((ROOT / "docs").glob(_spec['out'].format(v='*').split('/')[-1]))
|
|
|
+ _stale += [p.name for p in _old if p.name != _out.name]
|
|
|
+ if not _src.is_file():
|
|
|
+ _miss.append(_src.name)
|
|
|
+ continue
|
|
|
+ for _rel in re.findall(r'!\[[^\]]*\]\((figures/[^)]+)\)', _src.read_text(encoding='utf-8')):
|
|
|
+ if not (ROOT / "docs" / _rel).is_file():
|
|
|
+ _figmiss.append(_rel)
|
|
|
+ _miss += _figmiss
|
|
|
+ _ok4 = not _miss
|
|
|
+ row(f"交付文档三件 (需求分析/设计说明/数据要求说明 · v{_V2})", _ok4,
|
|
|
+ ("3/3 份在位, 文档名含当前版本号, 插图全在位" if _ok4 else
|
|
|
+ f"缺 {len(_miss)} 件: {', '.join(_miss[:3])}"
|
|
|
+ + (f";同名旧版残留: {', '.join(_stale[:3])}" if _stale else '')
|
|
|
+ + " —— 跑 python scripts/delivery_docs_build.py 重建"))
|
|
|
except Exception as _e:
|
|
|
row("交付文档三件", False, f"{type(_e).__name__}: {_e}")
|
|
|
# 反向呼应审计 (用户令 2026-09-17): 自**输出**回溯 功能与算法 → **输入**, 逐件问"这件产物能不能
|