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

Function getInstalledPythons

packages/python/src/version.ts:352–373  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

350}
351
352function getInstalledPythons(): Set<string> {
353 if (installedPythonsCache !== null) {
354 return installedPythonsCache;
355 }
356
357 if (process.env.VERCEL_BUILD_IMAGE) {
358 installedPythonsCache = getInstalledPythonsFromFilesystem();
359 return installedPythonsCache;
360 }
361
362 const uvPath = findUvInPath();
363 if (!uvPath) {
364 throw new NowBuildError({
365 code: 'UV_ERROR',
366 link: 'https://vercel.link/python-version',
367 message: 'uv is required but was not found in PATH.',
368 });
369 }
370 const uv = new UvRunner(uvPath);
371 installedPythonsCache = uv.listInstalledPythons();
372 return installedPythonsCache;
373}
374
375/**
376 * Reset the installed Python versions cache.

Callers 1

isInstalledFunction · 0.85

Calls 3

listInstalledPythonsMethod · 0.95
findUvInPathFunction · 0.90

Tested by

no test coverage detected