Файли
openidea/crates/ide-sdk/Cargo.toml
T
LU XIANGRUIтаwildcatDownstairs e57a709d19 feat(python): create and detect Pipenv environments (#5449)
"Add Python Interpreter" has a new **Pipenv Environment** type. It runs `pipenv --python <base>` in the project, which writes a `Pipfile` (importing `requirements.txt` if there is one) when the project has none. With **Install packages from Pipfile** checked, it then runs `pipenv install --dev`. The result becomes the project interpreter. If the project already has a Pipenv environment, it is reused and `--python` is not passed, because pipenv replaces an environment built on another Python without asking. When the versions differ, nothing is changed and the dialog says so. The project's Pipenv environment is also detected: it is listed as `Python 3.13 (Pipenv: <project>)` with the Pipfile icon, and it is the project interpreter when none is configured (after a `.venv` or pixi environment in the project, before the mise/asdf pin).
Until now Pipenv was only a run wrapper (`pipenv run`). Its environments were listed as plain virtualenvs named after their folder (`shop-Kpos5yRM`) and were never tied to their project. Detection does not start pipenv, which takes about a second. It looks for the `Pipfile` the way pipenv does, in the opened folder or one above it, and computes the folder name pipenv gives that project's environment: the folder name, `-`, and 8 characters of the URL-safe base64 SHA-256 of the `Pipfile` path. It looks for that name in `WORKON_HOME`, `~/.virtualenvs` and `$XDG_DATA_HOME/virtualenvs`, after the project's own `.venv`. An environment found elsewhere in the list is labelled as Pipenv's only if its `.project` names a folder with a `Pipfile` and its name matches. `ide-sdk` now depends on `sha2` and `base64`; both were already in `Cargo.lock`.

Co-authored-by: wildcatDownstairs <[email protected]>
2026-11-24 01:28:27 +08:00

31 рядки
800 B
TOML

[package]
name = "ide-sdk"
description = "SDKs / toolchains: interpreter discovery (Python, Node.js, Rust, Go, TypeScript), virtualenvs, pip, and applying the selected toolchain to language servers, run configurations and terminals"
version.workspace = true
edition.workspace = true
license.workspace = true
[dependencies]
base64.workspace = true
dirs.workspace = true
dunce.workspace = true
ignore.workspace = true
ide-core.workspace = true
ide-language.workspace = true
ide-run.workspace = true
ide-vfs.workspace = true
quick-xml = "0.42"
serde.workspace = true
serde_json.workspace = true
sha2 = "0.10"
specta.workspace = true
tempfile.workspace = true
toml.workspace = true
tracing.workspace = true
url = "2"
zip.workspace = true
[dev-dependencies]
flate2.workspace = true
tar.workspace = true