({
pythonPath,
pipPath,
uvPath,
filePath,
workPath,
targetDir,
meta,
args = [],
}: InstallRequirementsFileArg)
| 517 | } |
| 518 | |
| 519 | export 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 | } |
nothing calls this directly
no test coverage detected