Skip to content

Commit 770dfb4

Browse files
committed
fix: install venv before pip
1 parent 025098a commit 770dfb4

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

dist/legacy/setup-cpp.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/legacy/setup-cpp.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/modern/setup-cpp.mjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

dist/modern/setup-cpp.mjs.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/python/python.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,16 @@ export async function setupPython(
3636
assert(installInfo.bin !== undefined)
3737
const foundPython = installInfo.bin
3838

39+
// setup venv
40+
await setupVenv(foundPython)
41+
3942
// setup pip
4043
const foundPip = await findOrSetupPip(foundPython)
4144
if (foundPip === undefined) {
4245
throw new Error("pip was not installed correctly")
4346
}
4447

4548
await setupPipx(foundPython)
46-
4749
await setupWheel(foundPython)
4850

4951
return installInfo as InstallationInfo & { bin: string }
@@ -61,19 +63,17 @@ async function setupPipx(foundPython: string) {
6163
}
6264
}
6365
await execa(foundPython, ["-m", "pipx", "ensurepath"], { stdio: "inherit" })
64-
await setupVenv(foundPython)
6566
} catch (err) {
6667
notice(`Failed to install pipx: ${(err as Error).toString()}. Ignoring...`)
6768
}
6869
}
6970

7071
async function setupVenv(foundPython: string) {
7172
if (await hasVenv(foundPython)) {
73+
info("venv module already installed.")
7274
return
7375
}
7476

75-
info("venv module not found. Installing it...")
76-
7777
try {
7878
await setupPipPackSystem("venv")
7979
} catch (err) {

0 commit comments

Comments
 (0)