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

Function installRequirement

packages/python/src/install.ts:483–506  ·  view source on GitHub ↗
({
  pythonPath,
  pipPath,
  uvPath,
  dependency,
  version,
  workPath,
  targetDir,
  meta,
  args = [],
}: InstallRequirementArg)

Source from the content-addressed store, hash-verified

481// so vc_init should do runtime version checks to be compatible with any recent
482// version of its dependencies
483export async function installRequirement({
484 pythonPath,
485 pipPath,
486 uvPath,
487 dependency,
488 version,
489 workPath,
490 targetDir,
491 meta,
492 args = [],
493}: InstallRequirementArg) {
494 const actualTargetDir = targetDir || workPath;
495 if (
496 meta.isDev &&
497 (await isInstalled(pythonPath, dependency, actualTargetDir))
498 ) {
499 debug(
500 `Skipping ${dependency} dependency installation, already installed in ${actualTargetDir}`
501 );
502 return;
503 }
504 const exact = `${dependency}==${version}`;
505 await pipInstall(pipPath, uvPath, workPath, [exact, ...args], targetDir);
506}
507
508interface InstallRequirementsFileArg {
509 pythonPath: string;

Callers 1

unit.test.tsFile · 0.85

Calls 3

debugFunction · 0.90
pipInstallFunction · 0.85
isInstalledFunction · 0.70

Tested by

no test coverage detected