Skip to content

Releases

Python Support v1.2.0

Choose a tag to compare

@github-actions github-actions released this 23 Nov 06:11
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

Python Support v1.1.0

Choose a tag to compare

@github-actions github-actions released this 23 Nov 05:55
48cbeae

中文

  • 「设置 › 语言与框架 › Python」顶部显示当前使用的 Python 解释器,点击可打开「工具链」页更换。下面的预览卡片按尚未保存的设置画出类型检查模式、诊断范围、自动导入补全和补全函数括号的效果。

  • 「设置 › 构建、执行、部署 › 构建工具 › Python」显示 Lithe 查找解释器的顺序:项目固定的解释器和项目里的 .venv、venv、.conda,然后是全局设置,最后是自动发现;最前面标出「Python 解释器覆盖路径」是否设置,以及设置后哪些流程改用它。

  • 设置了「Python 解释器覆盖路径」时,语言页的解释器下面会说明:构建任务、运行和 pytest 用覆盖路径,Pyrefly 分析和调试仍用「工具链」页解析出的解释器。

  • 「显示类型错误」的四档现在都按标题生效。以前随包的 Pyrefly 1.4.1 只认“关闭”,其他两档和“始终开启”效果一样:

    • 始终开启:所有文件都显示,没有 Pyrefly 配置的文件按类型检查模式检查;
    • 仅已配置项目:只有 pyrefly.toml 或 [tool.pyrefly] 覆盖的文件显示;
    • 仅报告缺失导入:Pyrefly 已经没有这个模式,没有 Pyrefly 配置的文件改按“基础”检查,报告无法解析的导入和少数 Pyrefly 确定的错误;
    • 关闭:所有文件都不显示,包括有自己 Pyrefly 配置的项目。

    悬停、跳转和补全在各档都照常可用。

  • 类型检查模式新增“宽松”预设。“自动”会沿用附近的 mypy 或 Pyright 配置,没有时按“基础”检查。

  • 类型检查模式和自动导入路径风格的说明写明了它们和其他设置的关系,例如「显示类型错误」不是“始终开启”时预设怎样生效,关闭「自动导入补全」后只有代码操作会用到路径风格。

升级与兼容性

Python Support v1.1.0 要求 Lithe 0.8.9 或更新版本。从 0.8.10 开始,Lithe 还能按 shebang 自动识别无后缀脚本。已经保存的设置都继续生效。

调试需要 Python 3.10 或更新版本。内置的 debugpy 1.8.22 不支持 Python 3.9,以前在 3.9 上启动调试会直接退出、没有任何提示;现在 Lithe 会在启动调试前检查解释器版本。运行、测试和依赖树仍支持 Python 3.9。macOS 自带的 /usr/bin/python3 是 3.9,调试请在「工具链」页改用 uv、pyenv 或 python.org 安装的 Python 3.10 以上版本,或项目里用它们建的 .venv。

已知限制:在 macOS 和 Linux 上,建在项目外的虚拟环境(python -m venv、uv venv、virtualenv,以及 Poetry、Pipenv 默认建的环境)和 Homebrew 安装的 Python 暂时不能在「工具链」页选作解释器(#2316)。在此之前,可以把环境建在项目里的 .venv(Poetry 用 poetry config virtualenvs.in-project true,Pipenv 设 PIPENV_VENV_IN_PROJECT=1),或者固定 uv、pyenv、python.org 安装的解释器;只需要运行和 pytest 时,也可以把环境里的 python 填进「Python 解释器覆盖路径」。


English

  • Settings › Languages & Frameworks › Python now shows the Python interpreter in use at the top. Click it to change it on the Toolchains page. The preview cards below draw the effect of the type checking mode, diagnostic scope, auto-import completions and function parentheses, following settings you have not saved yet.

  • Settings › Build, Execution, Deployment › Build Tools › Python shows the order in which Lithe looks for an interpreter: the project's pinned interpreter and its .venv, venv or .conda, then the global setting, then automatic discovery. It first shows whether Python executable override is set, and which work uses it when it is.

  • When Python executable override is set, the language page says so under the interpreter: build tasks, runs and pytest use the override, while Pyrefly analysis and debugging still use the interpreter the Toolchains page resolves.

  • All four Display type errors choices now do what their titles say. The bundled Pyrefly 1.4.1 used to honor only Off, and the other two choices behaved like Always on:

    • Always on: every file shows type errors, and files without a Pyrefly config are checked by the type checking mode.
    • Configured projects only: only files a pyrefly.toml or [tool.pyrefly] covers show them.
    • Missing imports only: Pyrefly no longer has this mode, so files without a Pyrefly config are checked as Basic, which reports unresolved imports and a few other errors Pyrefly is sure of.
    • Off: no file shows them, including projects with their own Pyrefly config.

    Hover, go to definition and completion keep working with every choice.

  • The type checking mode has a new Legacy preset. Automatic follows a nearby mypy or Pyright config, and checks as Basic when there is none.

  • The descriptions of the type checking mode and the auto-import module path style now explain how they depend on other settings. For example, they say how the preset applies when Display type errors is not Always on, and that with Auto-import completions off only code actions use the path style.

Upgrade and compatibility

Python Support v1.1.0 requires Lithe 0.8.9 or later. Starting with 0.8.10, Lithe can also recognize extensionless scripts by their shebang. Settings you have saved keep working.

Debugging requires Python 3.10 or later. The bundled debugpy 1.8.22 does not support Python 3.9, and starting a debug session on 3.9 used to exit without any message. Lithe now checks the interpreter version before it starts debugging. Runs, tests and the dependency tree still support Python 3.9. The /usr/bin/python3 that comes with macOS is 3.9, so to debug, choose Python 3.10 or later installed by uv, pyenv or python.org on the Toolchains page, or a .venv in the project made from one.

Known limitation: on macOS and Linux, virtual environments outside the project (made by python -m venv, uv venv or virtualenv, and the environments Poetry and Pipenv create by default) and Homebrew Python cannot be chosen on the Toolchains page yet (#2316). Until then, create the environment in the project as .venv (for Poetry, poetry config virtualenvs.in-project true; for Pipenv, set PIPENV_VENV_IN_PROJECT=1), or pin an interpreter installed by uv, pyenv or python.org. If you only need runs and pytest, you can also enter the environment's python in Python executable override.

Lithe Store 会在收录后提供此版本。打开 设置 → 插件 → 插件市场,搜索 Python Support。

SHA-256

124c37e0f1da2b5515075f22761840c03d7898f878768854005e7ad705debecd  ./python-support-1.1.0-darwin-arm64.zip
8e241fc862b6b56d7ace8a510c85a9af61f13f4a31fc68c8d9a2ea3bed7e07d3  ./python-support-1.1.0-darwin-x64.zip
e45005abfd847d20e596866553b4d7429cd53838cc7891fe7bf98b3f61e00cbf  ./python-support-1.1.0-linux-arm64.zip
76cfcd365b6d6c18e6df664fdb03ecc3347092fb8ca5eee2145d8b058a8a47cc  ./python-support-1.1.0-linux-x64.zip
63b87282f17c2db6c850cf548b539e81d0b6bfddd9622bbcbc4516b637864bf6  ./python-support-1.1.0-windows-arm64.zip
d0d3181e773b7a248e9956f3bba99cf677a1fa17bdcf28dd370af6a66b5c115d  ./python-support-1.1.0-windows-x64.zip

Python Support v1.0.0

Choose a tag to compare

@github-actions github-actions released this 20 Nov 13:41
50daeb2

中文

  • 在 Lithe 0.8.10 及以上版本中,打开首行含 Python shebang 的无后缀脚本即可使用高亮、注释和 Pyrefly 诊断。
  • Toolchains 可从 Conda 环境登记表、uv 自定义安装目录和其他受支持的环境位置发现 Python。项目的 .python-version 和 requires-python 参与解释器选择。
  • Pyrefly 与宿主选定的解释器保持一致。插件包内的后端可以在尚未安装 Python 时启动 Pyrefly。
  • Build 面板可用 pytest 收集测试,按已发现的套件和用例精确运行。运行 pytest 和 debugpy 仍需要可用的项目解释器。

升级与兼容性

Python Support v1.0.0 要求 Lithe 0.8.9 或更新版本。Lithe 0.8.9 支持安装此插件并处理 .py、.pyi 和 .pyw 文件。从 0.8.10 开始,Lithe 还能按 shebang 自动识别无后缀脚本。

使用兼容的旧版 Lithe 时,仍可手动安装 Python Support v0.1.1 预发布版。手动安装时请选择对应操作系统和架构的 ZIP。


English

  • With Lithe 0.8.10 or later, open extensionless scripts with a Python shebang to get highlighting, comment commands, and Pyrefly diagnostics.
  • Toolchains can find Python from the Conda environment registry, a custom uv installation directory, and other supported environment locations. The project's .python-version and requires-python help select an interpreter.
  • Pyrefly uses the interpreter selected in Lithe. The bundled backend can start Pyrefly before Python is installed.
  • The Build panel can collect tests with pytest and run an exact discovered suite or case. Running pytest and debugpy still requires an available project interpreter.

Upgrade and compatibility

Python Support v1.0.0 requires Lithe 0.8.9 or later. Lithe 0.8.9 can install the plugin and work with .py, .pyi, and .pyw files. Starting with 0.8.10, Lithe can also recognize extensionless scripts by their shebang.

On compatible older versions of Lithe, you can still install the Python Support v0.1.1 prerelease manually. For manual installation, choose the ZIP for your operating system and architecture.

Lithe Store 会在收录后提供此版本。打开 设置 → 插件 → 插件市场,搜索 Python Support。

SHA-256

b5ee7bab108d944f525b4544bb6828fe822e09403dd86837d2e44d3abf9dbbb4  ./python-support-1.0.0-darwin-arm64.zip
7f4d578562d15a3d6a17407bb45c79abf2ac0dfaeb3788192dad0c2137d0187e  ./python-support-1.0.0-darwin-x64.zip
becb1088d165c0d648267ccb73fd18147333a5b0f34e668961cf72bd1d79e310  ./python-support-1.0.0-linux-arm64.zip
3d5d9cc558c2ef723103e2c4964dbe69707ea78cfee42d83524da1b0fcda627d  ./python-support-1.0.0-linux-x64.zip
eaed2dd44a251a8a8088ee47cab16ca5f79d0c6834d5ca7cf5d45b2a02b62562  ./python-support-1.0.0-windows-arm64.zip
8d84c841a44520e7c42346e2fdeb3c12941b54c66e49c6b27cb5b38692f2ad30  ./python-support-1.0.0-windows-x64.zip

Python Support v0.1.1

Python Support v0.1.1 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 18 Nov 06:22

兼容性:按插件契约 v0(schemaVersion 0、pluginAPIVersion 0)构建,需要支持声明式插件契约 v0 与项目内工具环境(.venv)信任解析的新版 Lithe 桌面端(desktop-v* 预发布)。

0.1.1 修复在可写插件目录(如 Windows 默认安装路径)下启动 debugpy 调试会话时,debugpy/adapter 拉起的 debugpy/launcher 子进程未继承 -B 而在插件包 vendor/debugpy/ 内生成 __pycache__ 字节码的问题:

  • 新增隔离启动入口 scripts/debugpy_adapter.py(以 python -I -B 运行),在加载 vendor/debugpy/adapter/__main__.py 前显式设置 PYTHONDONTWRITEBYTECODE=1,确保 debugpy/launcher 与被调试进程均不会向已安装插件目录写入任何 .pyc 字节码文件,同时兼容 Python 3.9–3.14 的 -I 隔离模式。

兼容性:

  • 按插件契约 v0(schemaVersion: 0、pluginAPIVersion: 0)构建,需配合新版 Lithe 桌面端(desktop-v* 预发布)。
  • 本版本为预发布(Pre-release),Lithe Store 自动追踪会跳过它。

安装:预发布版本,Lithe Store 自动追踪会跳过。下载对应平台的 ZIP,在 设置 → 插件 中点击 从文件安装…,选中 ZIP 后核对 SHA-256 并确认。

SHA-256:

python-support-0.1.1-darwin-arm64.zip 3eac92f40fdb5da8cde2d4397b2ce46c782e226e9fe24dee7180e561d15162a7
python-support-0.1.1-darwin-x64.zip 923fd06c62f1cf5c5eba9483d9fbec5385d8186489b4b38f663ec7322c6c8a4a
python-support-0.1.1-windows-x64.zip 3159559366401320be535467850c12ce201865e37acab0df33b908f1f49e130a
python-support-0.1.1-windows-arm64.zip 7cfd99801511cd49ef66284418ec7b41b80718f80bcd891cc9fe2ea84062bda7
python-support-0.1.1-linux-x64.zip 66483d04270a4ae0ff4d959b8658fd2b5b173b84f827d3d39c960347a899c012
python-support-0.1.1-linux-arm64.zip 519bd322812b274e9d916db0e08806784769024dcdb59e2cf9a9e578edf83d6f

Python Support v0.1.0

Python Support v0.1.0 Pre-release
Pre-release

Choose a tag to compare

@Mucheen Mucheen released this 18 Nov 05:47

兼容性:按插件契约 v0(schemaVersion 0、pluginAPIVersion 0)构建,需要支持声明式插件契约 v0 与项目内工具环境(.venv)信任解析的新版 Lithe 桌面端(desktop-v* 预发布)。

Python Support 首个预发布版本(M1 + M2 声明式插件),基于 Pyrefly 1.4.1 与 debugpy 1.8.22 为新版 Lithe 桌面端提供开箱即用的 Python 开发支持:

  • Python 语言与静态分析:识别 .py / .pyi / .pyw,内置 6 平台预打包的 Pyrefly 1.4.1 语言服务器(pyrefly lsp),提供实时类型检查、跳转定义、查找引用、悬停文档、自动导入补全及工作区排除目录同步,原生识别项目 .venv 虚拟环境。
  • 工具链与虚拟环境解析:支持项目固定解释器、.venv / venv 项目内虚拟环境(受宿主工作区信任开关保护)、VIRTUAL_ENV、PATH 以及 Homebrew、Framework、系统路径、pyenv / pyenv-win、uv、conda / miniforge / miniconda / anaconda 自动发现。
  • 项目模型、构建任务与测试:纯静态 AST + tomllib / 内置 tomli 模型分析脚本(零用户代码执行),自动识别 [project.scripts]、包 __main__.py、顶层 __main__ 脚本、Django manage.py、FastAPI 与 Flask 运行入口;拆分 python(pip install -r requirements.txt、mypy、pytest JUnit XML 报告与用例过滤)、uv(sync / lock)、conda(env update)与 ruff(check / format)四个独立构建系统。
  • 源码级调试与开发向导:内置 debugpy 1.8.22 调试适配器(支持本地单文件/目标 launch 与远程 attach 路径映射,自动保持已安装插件目录只读不写入字节码)、终端 Python Traceback 点击跳转源码,以及支持 None / venv / uv 环境初始化的新建 Python 项目向导与完整简体中文翻译。

权限:debug.attach、debug.launch、languageServer.launch、process.build、project.generate。

兼容性与已知限制:

  • 按插件契约 v0(schemaVersion: 0、pluginAPIVersion: 0)构建,需配合支持声明式契约 v0 的新版 Lithe 桌面端(desktop-v* 预发布);项目内 .venv / venv 解释器自动探测与信任开关需配合包含 1lck/Lithe-IDEA#2136(及 Lithe-IDEA/Lithe-core-rust#93)的桌面端版本。
  • 本版本为预发布(Pre-release),Lithe Store 自动追踪会跳过它,暂不自动进入正式插件市场索引。

安装:预发布版本,Lithe Store 自动追踪会跳过。下载对应平台的 ZIP,在 设置 → 插件 中点击 从文件安装…,选中 ZIP 后核对 SHA-256 并确认。

SHA-256:

python-support-0.1.0-darwin-arm64.zip 77bc7feb2d0258cb3b82ba896e0aaa59df748c1e2d37511a7a9bb7ec9e843b61
python-support-0.1.0-darwin-x64.zip 1dfddcdb9792f5636fc7df4ca28c4007568657027be6e317d1662c3f8288b885
python-support-0.1.0-linux-arm64.zip be5e6fa1ba8888418d493dbbe9845ccfe903e6a8cc6aaaf8ff507dfcf496fc66
python-support-0.1.0-linux-x64.zip 55688993d7b794da76b563882859f049afd252255c9c20a4b3375e8ecb20f082
python-support-0.1.0-windows-arm64.zip 7d480cec2b13cd78868d2067eb00e25a344d1e89a926eabee866097ab0a7f609
python-support-0.1.0-windows-x64.zip 6a82c1a473dd4f39c4156be6549812146033370d5d0466889c508402c36d6844