fix(ci): ci.yml test/mypy job 先构建前端再 pip install

pyproject.toml 的 force-include 要求 web-ui/dist 存在,否则 pip install -e .
报 FileNotFoundError。ci.yml 的 test 和 mypy job 此前没有构建前端步骤,
导致全部 CI 失败。

修复:test(6 矩阵)和 mypy job 在 pip install 前加 setup-node + npm ci +
npm run build。frontend job 本来就有,不变。

同时清理 pyproject.toml:恢复 force-include(之前误改成 build-hook 但
hatchling 自定义 hook 需要插件注册,过于复杂)。
This commit is contained in:
Justin Gu
2026-07-07 22:14:03 +08:00
parent 9ab093a3c7
commit e8b088bca1
2 changed files with 23 additions and 2 deletions
+2 -2
View File
@@ -30,8 +30,8 @@ artifacts = [
[tool.hatch.build.targets.wheel]
packages = ["src/easy_tdx"]
# 前端 dist 映射到包内 easy_tdx/web/dist/,让 pip install 后开箱即用 UI。
# 运行时由 _resolve_web_dist_dir 第 4 级探测找到
# 前端 dist 映射到包内 easy_tdx/web/dist/。CIci.yml)、publishpublish.yml
# 和 releaserelease.yml)都会在 pip install / build 前先 npm run build
force-include = { "web-ui/dist" = "easy_tdx/web/dist" }
[tool.mypy]