mirror of https://github.com/aminya/setup-cpp
fix: ensure that pip is installed on linux
This commit is contained in:
parent
40212d6ffc
commit
1853202970
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -9,6 +9,7 @@ import { isBinUptoDate } from "./version"
|
||||||
import { join } from "path"
|
import { join } from "path"
|
||||||
import { getVersion } from "../../default_versions"
|
import { getVersion } from "../../default_versions"
|
||||||
import { InstallationInfo } from "./setupBin"
|
import { InstallationInfo } from "./setupBin"
|
||||||
|
import { setupAptPack } from "./setupAptPack"
|
||||||
|
|
||||||
let python: string | undefined
|
let python: string | undefined
|
||||||
let binDir: string | undefined
|
let binDir: string | undefined
|
||||||
|
@ -39,6 +40,9 @@ export async function setupPipPack(name: string, version?: string): Promise<Inst
|
||||||
// downgrade pip on Windows
|
// downgrade pip on Windows
|
||||||
// https://github.com/pypa/pip/issues/10875#issuecomment-1030293005
|
// https://github.com/pypa/pip/issues/10875#issuecomment-1030293005
|
||||||
execa.sync(python, ["-m", "pip", "install", "-U", "pip==21.3.1"], { stdio: "inherit" })
|
execa.sync(python, ["-m", "pip", "install", "-U", "pip==21.3.1"], { stdio: "inherit" })
|
||||||
|
} else if (process.platform === "linux") {
|
||||||
|
// ensure that pip is installed on Linux (happens when python is found but pip not installed)
|
||||||
|
await setupAptPack("python3-pip")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue