fix: remove forced installation of pip on windows

This commit is contained in:
Amin Yahyaabadi 2022-02-05 11:29:49 -08:00
parent dabb2db00e
commit 20b0642c37
3 changed files with 3 additions and 8 deletions

2
dist/setup_cpp.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -7,8 +7,6 @@ import { addPath } from "../path/addPath"
import { setupPython } from "../../python/python" import { setupPython } from "../../python/python"
import { isBinUptoDate } from "./version" import { isBinUptoDate } from "./version"
import { join } from "path" import { join } from "path"
import { isGitHubCI } from "../env/isci"
import { getVersion } from "../../default_versions"
let pip: string | undefined let pip: string | undefined
@ -18,15 +16,12 @@ let binDir: string | undefined
export async function setupPipPack(name: string, version?: string) { export async function setupPipPack(name: string, version?: string) {
// setup python and pip if needed // setup python and pip if needed
if (pip === undefined) { if (pip === undefined) {
if (isGitHubCI() && process.platform === "win32") {
// run setupPython in actions_python anyways
await setupPython(getVersion("python", undefined), "", process.arch)
}
if (which.sync("pip3", { nothrow: true }) !== null) { if (which.sync("pip3", { nothrow: true }) !== null) {
pip = "pip3" pip = "pip3"
} else if (which.sync("pip", { nothrow: true }) !== null && (await isBinUptoDate("python", "3.0.0"))) { } else if (which.sync("pip", { nothrow: true }) !== null && (await isBinUptoDate("python", "3.0.0"))) {
pip = "pip" pip = "pip"
} else { } else {
info("pip3 was not found. Installing python")
await setupPython("3.x", "", process.arch) await setupPython("3.x", "", process.arch)
pip = "pip3" pip = "pip3"
} }