Repository navigation
feat(toolchain): 设置页原处选解释器,可用项目外的虚拟环境与 Hatch、virtualenvwrapper 环境(1.2.0 预发布) - #16
Merged
Merged
Conversation
- 两个设置页顶部的解释器行写 choose: true,变成在原处选择工具链安装的下拉菜单(宿主 #2312) - python 工具定义写 executableLinksOutsideHome: true(Core #177、宿主 #2321), 项目外 venv / uv venv / virtualenv、Poetry 与 Pipenv 的项目环境、Homebrew 安装可以选中, 按环境里的路径启动 - 新发现 Hatch 虚拟环境和 virtualenvwrapper 环境 - .python-version 写版本号或 requires-python 时只选基础解释器;写环境名时仍按名选环境 - 去掉没有用到的 run.start 权限 - 宿主 e2e 固定到 #2321 的提交,新增固定项目外 venv 的当前文件运行用例; 旧宿主不能安装 1.2.0,CI 去掉 0.8.9 兼容子集 - README、功能矩阵、v1.2.0 发布说明;v1.2.0 列入预发布标签
#2321 已合入宿主 main,固定版本从分支提交 93e21704 换成合入提交 58b527ed。
xiaoyumuxi
marked this pull request as ready for review
November 23, 2026 06:03
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
关联 Issue / Linked issue
PR 类型 / Type
版本升到 1.2.0(新增功能升次版本号)。按
release-lithe的规则,需要还没发布的宿主能力的版本仍然升次版本号,并以预发布发布:release.yml的PRERELEASE_TAGS已加上v1.2.0。改动说明 / What changes
背景 / Why
python -m venv、uv venv、virtualenv 建在项目外的环境,它的bin/python3链接到创建它的基础解释器;Homebrew 的libexec/bin/python3链接到 libexec 外的 framework。Core 以前一律以unsafePath拒绝。Poetry 和 Pipenv 默认就把环境建在项目外,所以这两类项目基本用不了。改动 / Changes
tool行加上choose: true(backend/src/view/mod.rs、view/language.rs)。宿主把这一行画成下拉菜单:列出自动选择、已发现和已添加的安装(带版本和来源)、添加目录,菜单底部仍可打开「工具链」页。选择只改设置窗口的草稿,保存后生效。需要宿主的ui0 内新增的choose(Lithe-IDEA/Lithe-core-rust#174、#175,桌面 1lck/Lithe-IDEA#2312)。python工具定义写executableLinksOutsideHome: true(toolDefinitions0 内的补充,Lithe-IDEA/Lithe-core-rust#177)。Core 允许程序的链接目标在主目录外,并按主目录下的布局路径探测和启动,所以 Python 在自己的环境里运行,Pyrefly、运行、pytest、调试和依赖树都能看到环境里装的包。主目录到程序之间的每一级目录仍必须在主目录内、不在工作区内。HATCH_DATA_DIR,未设置时取平台数据目录下的env/virtual,跳过隐藏的.pythons)和 virtualenvwrapper 的环境(WORKON_HOME,未设置时非 Windows 上的~/.virtualenvs)(backend/src/discovery.rs)。.python-version写版本号(如3.12)或pyproject.toml写了requires-python时,只选没有pyvenv.cfg的基础解释器,不会选到别的项目的虚拟环境;.python-version写的是环境名(pyenv-virtualenv 的做法)时仍按名字选同名环境(backend/src/discovery/metadata.rs的virtual_environment标记、discovery/project.rs)。Pipfile路径识别,所选解释器必须满足同目录的项目版本约束。run.startTestPythonSupportPluginRunCurrentFilePinnedEnvironment:固定一个建在项目外、python链接到基础解释器的虚拟环境,检查当前文件在这个环境里运行(去掉executableLinksOutsideHome会失败)。scripts/test.mjs核对清单里的新字段、choose和两类新发现。Rust 单元测试覆盖发现规则和choose。executableLinksOutsideHome,会拒绝整个清单,这一版本来就装不上旧宿主。完整套件仍按e2e/host/lithe-host.json固定的宿主跑。docs/feature-matrix.md、docs/releases/v1.2.0.md。设置预览截图按本分支重拍。不在本 PR 范围内 / Out of scope
截图 / Screenshots
固定宿主
58b527ed的 Viva 无头设置窗口,用本分支打出的darwin-arm64插件包。解释器行右侧新增下拉箭头,右边是来源徽标。语言设置页(中文、深色)
构建工具页(中文、深色)
语言设置页(英文、浅色、有未保存草稿)
类型专属:feat
范围检查 / Scope checks
58b527ed。scripts/test.mjs与 Rust 测试核对节点结构和choose。l10n/zh-Hans.json和words.rs。ui0 内的choose和toolDefinitions0 内的executableLinksOutsideHome,两者都是 0 内的补充,不升能力版本。验证 / Verification
cargo fmt --check、严格 Clippy、cargo test --locked(backend/)node scripts/package.mjs --platform darwin-arm64、归档测试、node scripts/test.mjsnode scripts/e2e-host.mjs(固定宿主58b527ed)RunCurrentFilePinnedEnvironment、固定解释器、覆盖路径、pytest、debugpy、包不变性。./internal/settingswindow -tags vivahead -run ^TestPythonPluginSettingsPreview$)本地 e2e 的 PATH
python3需要 3.10 以上并支持venv --copies;PYTEST_PYTHON必须是装了 pytest 的真实安装,不能是虚拟环境。没有在 Windows、Linux、真机 Homebrew 或原生窗口上验证。合入后打
v1.2.0标签,按PRERELEASE_TAGS发为预发布版,Lithe Store 不收录预发布;等包含 1lck/Lithe-IDEA#2312 和 #2321 的桌面端发布后再转正式版。