Skip to content

Commit 113d1f5

Browse files
committed
fix: install pipx system-wide first
1 parent 770dfb4 commit 113d1f5

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
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: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,13 @@ async function setupPipx(foundPython: string) {
5555
try {
5656
if (!(await hasPipx(foundPython))) {
5757
try {
58-
await setupPipPackWithPython(foundPython, "pipx", undefined, { upgrade: true, usePipx: false })
59-
} catch (err) {
60-
if (setupPipPackSystem("pipx", false) === null) {
61-
throw new Error(`pipx was not installed correctly ${err}`)
58+
// first try with the system-wide pipx
59+
if ((await setupPipPackSystem("pipx", isArch())) === null) {
60+
// try with pip
61+
await setupPipPackWithPython(foundPython, "pipx", undefined, { upgrade: true, usePipx: false })
6262
}
63+
} catch (err) {
64+
throw new Error(`pipx was not installed correctly ${err}`)
6365
}
6466
}
6567
await execa(foundPython, ["-m", "pipx", "ensurepath"], { stdio: "inherit" })
@@ -84,7 +86,7 @@ async function setupVenv(foundPython: string) {
8486
async function hasVenv(foundPython: string): Promise<boolean> {
8587
try {
8688
// check if venv module exits
87-
await execa(foundPython, ["-m", "venv", "-h"], { stdio: "inherit" })
89+
await execa(foundPython, ["-m", "venv", "-h"], { stdio: "ignore" })
8890
return true
8991
} catch {
9092
// if module not found, continue

0 commit comments

Comments
 (0)