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

Function getInstalledPythonsFromFilesystem

packages/python/src/version.ts:337–350  ·  view source on GitHub ↗
(
  basePath: string = UV_PYTHON_PATH_PREFIX
)

Source from the content-addressed store, hash-verified

335 * avoids spawning a `uv python list` subprocess.
336 */
337export function getInstalledPythonsFromFilesystem(
338 basePath: string = UV_PYTHON_PATH_PREFIX
339): Set<string> {
340 const result = new Set<string>();
341 for (const opt of allOptions) {
342 const version = pythonVersionString(opt);
343 if (!version) continue;
344 const binPath = join(basePath, 'bin', `python${version}`);
345 if (existsSync(binPath)) {
346 result.add(version);
347 }
348 }
349 return result;
350}
351
352function getInstalledPythons(): Set<string> {
353 if (installedPythonsCache !== null) {

Callers 2

unit.test.tsFile · 0.90
getInstalledPythonsFunction · 0.85

Calls 2

pythonVersionStringFunction · 0.85
addMethod · 0.45

Tested by

no test coverage detected