({
pythonPath,
pipPath,
uvPath,
dependency,
version,
workPath,
targetDir,
meta,
args = [],
}: InstallRequirementArg)
| 481 | // so vc_init should do runtime version checks to be compatible with any recent |
| 482 | // version of its dependencies |
| 483 | export 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 | |
| 508 | interface InstallRequirementsFileArg { |
| 509 | pythonPath: string; |
no test coverage detected