Skip to content

Commit

Permalink
fix: install pipx via pip too
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Jan 12, 2025
1 parent 627f57a commit 0528a87
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion dist/legacy/setup-cpp.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/legacy/setup-cpp.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/modern/setup-cpp.mjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/modern/setup-cpp.mjs.map

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions src/python/python.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,22 +61,22 @@ async function setupPipx(foundPython: string) {
if (!(await hasPipxModule(foundPython))) {
try {
// first try with the system-wide pipx
if ((await setupPipPackSystem("pipx", isArch())) === null) {
// try with pip
await setupPipPackWithPython(foundPython, "pipx", undefined, { upgrade: true, usePipx: false })
}
await setupPipPackSystem("pipx", isArch())
// then install with the system-wide pipx
await setupPipPackWithPython(foundPython, "pipx", undefined, { upgrade: true, usePipx: false })
} catch (err) {
throw new Error(`pipx was not installed correctly ${err}`)
throw new Error(`pipx was not installed completely: ${err}`)
}
}
if (await hasPipxModule(foundPython)) {
await execa(foundPython, ["-m", "pipx", "ensurepath"], { stdio: "inherit" })
return
} else if (await hasPipxBinary()) {
notice("pipx module not found. Trying to install with pipx binary...")
await execa("pipx", ["ensurepath"], { stdio: "inherit" })
return
} else {
notice("pipx module or pipx binary not found. Corrput pipx installation.")
throw new Error("pipx module or pipx binary not found. Corrput pipx installation.")
}
} catch (err) {
notice(`Failed to install pipx: ${(err as Error).toString()}. Ignoring...`)
Expand Down

0 comments on commit 0528a87

Please sign in to comment.