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

Function installRequirementsFile

packages/python/src/install.ts:519–549  ·  view source on GitHub ↗
({
  pythonPath,
  pipPath,
  uvPath,
  filePath,
  workPath,
  targetDir,
  meta,
  args = [],
}: InstallRequirementsFileArg)

Source from the content-addressed store, hash-verified

517}
518
519export async function installRequirementsFile({
520 pythonPath,
521 pipPath,
522 uvPath,
523 filePath,
524 workPath,
525 targetDir,
526 meta,
527 args = [],
528}: InstallRequirementsFileArg) {
529 // The Vercel platform already handles `requirements.txt` for frontend projects,
530 // but the installation logic there is different, because it seems to install all
531 // of the dependencies globally, whereas, for this Runtime, we want it to happen only
532 // locally, so we'll run a separate installation.
533
534 const actualTargetDir = targetDir || workPath;
535 if (
536 meta.isDev &&
537 (await areRequirementsInstalled(pythonPath, filePath, actualTargetDir))
538 ) {
539 debug(`Skipping requirements file installation, already installed`);
540 return;
541 }
542 await pipInstall(
543 pipPath,
544 uvPath,
545 workPath,
546 ['--upgrade', '-r', filePath, ...args],
547 targetDir
548 );
549}

Callers

nothing calls this directly

Calls 3

debugFunction · 0.90
areRequirementsInstalledFunction · 0.85
pipInstallFunction · 0.85

Tested by

no test coverage detected