fix: install venv before pip

This commit is contained in:
Amin Yahyaabadi 2025-01-12 02:55:14 -08:00
parent 025098a948
commit 770dfb4c2c
5 changed files with 8 additions and 8 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -36,6 +36,9 @@ export async function setupPython(
assert(installInfo.bin !== undefined)
const foundPython = installInfo.bin
// setup venv
await setupVenv(foundPython)
// setup pip
const foundPip = await findOrSetupPip(foundPython)
if (foundPip === undefined) {
@ -43,7 +46,6 @@ export async function setupPython(
}
await setupPipx(foundPython)
await setupWheel(foundPython)
return installInfo as InstallationInfo & { bin: string }
@ -61,7 +63,6 @@ async function setupPipx(foundPython: string) {
}
}
await execa(foundPython, ["-m", "pipx", "ensurepath"], { stdio: "inherit" })
await setupVenv(foundPython)
} catch (err) {
notice(`Failed to install pipx: ${(err as Error).toString()}. Ignoring...`)
}
@ -69,11 +70,10 @@ async function setupPipx(foundPython: string) {
async function setupVenv(foundPython: string) {
if (await hasVenv(foundPython)) {
info("venv module already installed.")
return
}
info("venv module not found. Installing it...")
try {
await setupPipPackSystem("venv")
} catch (err) {