From 71d073307313ff56f8d89196d940f84478474dbc Mon Sep 17 00:00:00 2001 From: BjoernAtBosch Date: Mon, 7 Oct 2024 09:25:28 +0000 Subject: [PATCH] [Fix] Move Python venv folder location to ~/.velocitas/packages/ --- docs/features/PACKAGES.md | 2 +- src/modules/exec.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/features/PACKAGES.md b/docs/features/PACKAGES.md index 66dbfc5..de3e97b 100644 --- a/docs/features/PACKAGES.md +++ b/docs/features/PACKAGES.md @@ -135,7 +135,7 @@ Other Python processes spawned from a Python-based program will **not** be autom (Because the dependencies of that scripts will probably differ from those of the calling program's component.) The venv of each component is created within the project cache directory in the folder `pyvenv`. For example the -component `Foo`s venv would be located in `/home/vscode/.velocitas/projects//pyvenv/foo/`. This also contains +component `Foo`s venv would be located in `/home/vscode/.velocitas/packages/.pyvenvs/foo/`. This also contains the installed dependencies of that component. ### `id` - string diff --git a/src/modules/exec.ts b/src/modules/exec.ts index 2ea080f..e589ca0 100644 --- a/src/modules/exec.ts +++ b/src/modules/exec.ts @@ -16,6 +16,7 @@ import { IPty, spawn } from 'node-pty'; import { exec } from 'node:child_process'; import { resolve } from 'node:path'; import { ExecSpec, ProgramSpec } from './component'; +import { getPackageFolderPath } from './package'; import { ProjectCache } from './project-cache'; import { ProjectConfig } from './projectConfig/projectConfig'; import { stdOutParser } from './stdout-parser'; @@ -151,7 +152,7 @@ async function createPythonVenv( cwd: string, loggingOptions: { writeStdout?: boolean; verbose?: boolean }, ) { - const venvDir = `${ProjectCache.getCacheDir()}/pyvenv/${componentId}`; + const venvDir = `${getPackageFolderPath()}/.pyvenvs/${componentId}`; let venvCreateCmd = command; if (command === 'pip') { venvCreateCmd = 'python';