mirror of
https://git.openapi.site/https://github.com/desirecore/market.git
synced 2026-12-05 20:19:32 +08:00
fix(python-runtime): 修正过时的 Hatch 路径与安装写法(1.0.4)/ correct stale Hatch paths and install commands (#242)
python-runtime 与 dev-environment-setup 还在描述客户端 10.0.105 之前的 Hatch 布局:正常安装时没有 runtime/hatch/hatch,probe-python.sh 的 hatch_path 恒空,Agent 接着就会用系统包管理器。文档的 CLI 写法同样有问题:Hatch 1.16.5 里没有 HATCH_HOME 和 HATCH_PYTHON_MIRROR_URL,不带 --private --dir 的 python install 装到用户数据目录并改写 .zshrc、.zprofile,DesireCore 也看不到那个 Python。 - 二进制改为随包的 static/toolchains/<平台>-<架构>/hatch/hatch;runtime/hatch/hatch 只有手动下载后才存在 - 先用已在 PATH 上的内置 Python;指定版本用 runtime/hatch/local/<版本> 的绝对路径,pip 走探测到的解释器 - 安装命令带 --private --dir,环境变量改为 PYAPP_INSTALL_DIR_HATCH;换下载源用 HATCH_PYTHON_CUSTOM_SOURCE_<NAME>,并写明 URL 形态约束 - probe-python.sh 按新布局查找,新增 hatch_bootstrap,只认与二进制同版本的分发;没有解包好的分发时不执行二进制,避免 --version 触发下载;输出的路径字段做 JSON 转义 - 写明这个 bash 探测脚本在 Windows 上不查找 Hatch,降级到 L3 前先试 L2 的 Windows 路径 - 记录首启导入把本机镜像地址写进 hatch-dist.json,导致 local/ 上的 Hatch 命令报 Unknown distribution source,并给出修复办法;客户端修复见 desirecore/desirecore#5578 - desirecore-runtime.md 的源码路径改为 packages/agent-service/src;decision-tree.md 补上 standalone 的 401 - 版本 python-runtime 1.0.3 → 1.0.4、dev-environment-setup 2.0.5 → 2.0.6,sidecar 与 i18n source_hash 同步;不设客户端版本门槛 Correct the Hatch paths and install commands in python-runtime and dev-environment-setup, which still described the layout from before client 10.0.105 and told Agents to run an install that edits shell startup files and lands where DesireCore cannot see it. probe-python.sh now finds the current layout, reports the unpacked distribution, and no longer triggers a download. 验证:catalog metadata 与 i18n 校验 0 error,translate --check 通过,market-i18n-real-repo 22/22;真实 Hatch 1.16.5 在隔离 HOME 下逐条跑过文档命令;standalone 隔离 HOME + mock 模型下真实 Bash 工具按文档跑通,未调用真实模型;探测脚本覆盖多种布局及含引号、反斜杠的路径。Windows 写法只对照源码。私有敏感词扫描未执行,经用户确认后合并。
This commit is contained in:
11 files changed
+276
-106
No files matched your search
@@ -45,9 +45,10 @@ Windows 上 `wsl` 字段值类似 `{ "installed": true, "version": "2", "default
|
||||
"desirecore_api": "https://127.0.0.1:38291",
|
||||
"system_python": { "path": "/opt/homebrew/bin/python3", "version": "3.12.4" },
|
||||
"system_pip": { "path": "/opt/homebrew/bin/pip3", "version": "24.0" },
|
||||
"hatch_path": "/Users/example/.desirecore/runtime/hatch/hatch",
|
||||
"hatch_path": "/Applications/DesireCore.app/Contents/static/toolchains/darwin-arm64/hatch/hatch",
|
||||
"hatch_version": "1.16.5",
|
||||
"hatch_versions": ["3.11", "3.12"],
|
||||
"hatch_bootstrap": "/Users/example/.desirecore/runtime/hatch/bootstrap/1.16.5-darwin-arm64",
|
||||
"hatch_versions": ["3.13"],
|
||||
"active_venv": "/Users/example/proj/.venv",
|
||||
"pep668": false,
|
||||
"pyenv_path": "",
|
||||
@@ -56,7 +57,10 @@ Windows 上 `wsl` 字段值类似 `{ "installed": true, "version": "2", "default
|
||||
```
|
||||
|
||||
字段语义:
|
||||
- `hatch_path` 空字符串表示二进制不存在
|
||||
- `system_python` / `system_pip` 是 PATH 解析到的结果,可能是 DesireCore 追加到 PATH 的内置 Python
|
||||
- `hatch_path` 空字符串表示没找到二进制,查找顺序见 `python-runtime/references/hatch-desirecore.md`;这个脚本在 Windows 上不查找 Hatch,恒为空
|
||||
- `hatch_bootstrap` 是客户端解包好的 Hatch 分发目录,直接调用 Hatch 时经 `PYAPP_INSTALL_DIR_HATCH` 传入,版本与二进制一致;空字符串表示解包还没完成或客户端早于 10.0.183
|
||||
- `hatch_version` 在 `hatch_bootstrap` 为空时读二进制旁边的 `asset.json`,读不到就是空字符串,不执行二进制(否则会触发下载)
|
||||
- `hatch_versions` 是 `${DESIRECORE_ROOT}/runtime/hatch/local/` 下的目录列表(即已通过 Hatch 安装的 Python 版本)
|
||||
- `active_venv` 取自 `$VIRTUAL_ENV` 环境变量
|
||||
- `pep668` 检测 `/usr/lib/python*/EXTERNALLY-MANAGED` 是否存在(Debian 12+/Ubuntu 23.04+ 启用)
|
||||
|
||||
Reference in new issue
Block a user