( venvPath: string, baseEnv: NodeJS.ProcessEnv = process.env, uvCacheDir?: string )
| 43 | } |
| 44 | |
| 45 | export function createVenvEnv( |
| 46 | venvPath: string, |
| 47 | baseEnv: NodeJS.ProcessEnv = process.env, |
| 48 | uvCacheDir?: string |
| 49 | ): NodeJS.ProcessEnv { |
| 50 | const env: NodeJS.ProcessEnv = { |
| 51 | ...getProtectedUvEnv(baseEnv, uvCacheDir), |
| 52 | VIRTUAL_ENV: venvPath, |
| 53 | UV_PROJECT_ENVIRONMENT: venvPath, |
| 54 | UV_NO_DEV: 'true', |
| 55 | }; |
| 56 | const binDir = getVenvBinDir(venvPath); |
| 57 | const existingPath = env.PATH || process.env.PATH || ''; |
| 58 | env.PATH = existingPath ? `${binDir}${pathDelimiter}${existingPath}` : binDir; |
| 59 | return env; |
| 60 | } |
| 61 | |
| 62 | /** |
| 63 | * Parse the `version` field from a pyvenv.cfg file and return the |
no test coverage detected