дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-09 03:05:40 +02:00
feat(interpreters): add an existing Python virtual environment as an interpreter (#2076)
Refs #1907 Add Python Interpreter → Existing environment: Browse picks the environment folder, which is resolved right away (pyvenv.cfg, bin/python or Scripts\python.exe) and added to the interpreter list as "Python X.Y (<env name>)", then remembered. Picking the folder rather than the executable keeps the environment's identity, since the native file picker resolves the venv's python symlink to the base interpreter. Works for `python -m venv` and uv environments; a broken environment shows an error instead of being added. Probing runs off the command thread. Co-authored-by: Inf1mum <[email protected]>
Цей коміт міститься в:
1 джерело
9673ccc687
коміт
32a778d28d
13 files changed
+430
-25
No files matched your search
@@ -411,6 +411,7 @@ pub fn builder() -> tauri_specta::Builder<tauri::Wry> {
|
||||
tools::jdk_download_location,
|
||||
tools::jdk_download,
|
||||
sdk::sdk_detect,
|
||||
sdk::sdk_python_interpreter,
|
||||
sdk::sdk_python_effective,
|
||||
sdk::sdk_php_effective,
|
||||
sdk::sdk_php_xdebug,
|
||||
|
||||
@@ -96,6 +96,17 @@ pub async fn sdk_locate_tools(
|
||||
ide_host::ops::sdk::sdk_locate_tools(&state.host, window.label(), names, near).await
|
||||
}
|
||||
|
||||
/// An existing Python executable or virtualenv folder as an SDK; `None` if Python cannot run.
|
||||
#[tauri::command]
|
||||
#[specta::specta]
|
||||
pub async fn sdk_python_interpreter(
|
||||
window: Window,
|
||||
state: State<'_, AppState>,
|
||||
path: PathBuf,
|
||||
) -> IdeResult<Option<Sdk>> {
|
||||
ide_host::ops::sdk::sdk_python_interpreter(&state.host, window.label(), path).await
|
||||
}
|
||||
|
||||
/// Creates a Python environment with `tool` (`venv` / `uv` / `poetry`); output streams through `on_output`.
|
||||
#[tauri::command]
|
||||
#[specta::specta]
|
||||
|
||||
Reference in new issue
Заблокувати користувача