Skip to content

Python Support v1.2.0

Latest

Choose a tag to compare

@github-actions github-actions released this 23 Nov 06:11
· 2 commits to main since this release
bd1ac13

中文

  • 「设置 › 语言与框架 › Python」和「设置 › 构建、执行、部署 › 构建工具 › Python」顶部的解释器那一行变成了下拉菜单:点它可以在原处为项目或全局选择一个找到的解释器,或者添加其他目录;菜单底部仍能打开「工具链」页。以前点击只会跳到「工具链」页。
  • 建在项目外的虚拟环境可以用作解释器了(#2316)。在 macOS 和 Linux 上,这类环境里的 python 通常链接到创建它的基础 Python,以前 Lithe 会拒绝它们,现在按环境里的路径启动,Pyrefly、运行、pytest、调试和依赖树都能看到装在环境里的包:
    • python -m venv、uv venv、virtualenv 建在别处的环境,可以在下拉菜单里添加它的目录;
    • 项目有 poetry.lock 或 Pipfile 时,Poetry、Pipenv 为这个项目建的环境会自动选中;
    • Homebrew 安装的 Python 也会出现在找到的解释器里。
  • 新找到两类环境:Hatch 的虚拟环境(HATCH_DATA_DIR,没有设置时是平台的数据目录),以及 virtualenvwrapper 的环境(WORKON_HOME,没有设置时 macOS 和 Linux 上的 ~/.virtualenvs)。
  • .python-version 写版本号(例如 3.12)或 pyproject.toml 写了 requires-python 时,Lithe 只选基础解释器,不会选到别的项目的虚拟环境。.python-version 写的是环境名时(pyenv-virtualenv 的做法),仍选同名的环境。

升级与兼容性

这是预发布版本,需要 0.8.14 之后发布的 Lithe 桌面端。旧版本的 Lithe 读不了这个版本的插件清单,不能安装它;请继续使用 Python Support v1.1.0,它支持 Lithe 0.8.9 或更新版本。已经保存的设置和固定的解释器都继续生效。

调试仍需要 Python 3.10 或更新版本。


English

  • The interpreter row at the top of Settings › Languages & Frameworks › Python and Settings › Build, Execution, Deployment › Build Tools › Python is now a drop-down menu. Click it to choose a found interpreter for the project or for all projects, or to add another directory, right where you are. The menu still opens the Toolchains page at the bottom. Clicking the row used to only open the Toolchains page.
  • Virtual environments outside the project can now be used as the interpreter (#2316). On macOS and Linux the python in such an environment usually links to the base Python it was made from, and Lithe used to refuse it. Lithe now starts it from the environment's own path, so Pyrefly, runs, pytest, debugging and the dependency tree all see the packages installed in the environment:
    • For an environment made elsewhere by python -m venv, uv venv or virtualenv, add its directory from the drop-down menu.
    • When the project has a poetry.lock or a Pipfile, the environment Poetry or Pipenv made for the project is chosen automatically.
    • Python installed by Homebrew is also among the found interpreters.
  • Two more kinds of environments are found: Hatch virtual environments (in HATCH_DATA_DIR, or the platform's data directory when it is not set), and virtualenvwrapper environments (in WORKON_HOME, or ~/.virtualenvs on macOS and Linux when it is not set).
  • When .python-version names a version (such as 3.12) or pyproject.toml sets requires-python, Lithe chooses only base interpreters, never another project's virtual environment. When .python-version names an environment, as pyenv-virtualenv does, Lithe still chooses the environment with that name.

Upgrade and compatibility

This is a prerelease. It requires a Lithe desktop release after 0.8.14. Earlier versions of Lithe cannot read this version's plugin manifest and cannot install it; keep using Python Support v1.1.0, which supports Lithe 0.8.9 or later. Settings you have saved and interpreters you have pinned keep working.

Debugging still requires Python 3.10 or later.

下载对应平台的 ZIP。打开 设置 → 插件 → 从文件安装…,核对 SHA-256 后确认。

SHA-256

fcbb2e400316723f9943eabf281913aa98999a2fc27e119cba7526df9327e233  ./python-support-1.2.0-darwin-arm64.zip
8184b9e99e74018ac2254abbb95b66962d8d5dd3e4cc497c840f9a07ea22e550  ./python-support-1.2.0-darwin-x64.zip
398b258457b2f26b12efcf522d918f8b21f5204d09e8ee1db4d0d53c09d530eb  ./python-support-1.2.0-linux-arm64.zip
2111ef73a0e88b1d35bda4e600b6c682a256c7b894f9fa670526f1075757f3ed  ./python-support-1.2.0-linux-x64.zip
122ff5bfde8c1852bf655068d44057ac105595d438a5b5ddc35ff0864909c302  ./python-support-1.2.0-windows-arm64.zip
88fb51fa6b60b743f0eae369ef305e37d91c8fd7fa88cba1639b7cb852cee45c  ./python-support-1.2.0-windows-x64.zip