MCPcopy Create free account
hub / github.com/vercel/vercel / createVenvEnv

Function createVenvEnv

packages/python/src/utils.ts:45–60  ·  view source on GitHub ↗
(
  venvPath: string,
  baseEnv: NodeJS.ProcessEnv = process.env,
  uvCacheDir?: string
)

Source from the content-addressed store, hash-verified

43}
44
45export 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

Callers 2

unit.test.tsFile · 0.90
buildFunction · 0.90

Calls 2

getProtectedUvEnvFunction · 0.90
getVenvBinDirFunction · 0.85

Tested by

no test coverage detected