fix: do not warn on pipx, venv, setuptools installations

This commit is contained in:
Amin Yahyaabadi 2024-10-31 00:58:11 -07:00
parent 75454f9c75
commit b8fbd53a44
6 changed files with 12 additions and 8 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@ import { dirname, join, parse as pathParse } from "path"
import { getExecOutput } from "@actions/exec" import { getExecOutput } from "@actions/exec"
import ciInfo from "ci-info" import ciInfo from "ci-info"
const { GITHUB_ACTIONS } = ciInfo const { GITHUB_ACTIONS } = ciInfo
import { info, warning } from "ci-log" import { info, notice, warning } from "ci-log"
import { addPath } from "envosman" import { addPath } from "envosman"
import { execa } from "execa" import { execa } from "execa"
import { readdir } from "fs/promises" import { readdir } from "fs/promises"
@ -63,7 +63,7 @@ async function setupPipx(foundPython: string) {
await execa(foundPython, ["-m", "pipx", "ensurepath"], { stdio: "inherit" }) await execa(foundPython, ["-m", "pipx", "ensurepath"], { stdio: "inherit" })
await setupVenv(foundPython) await setupVenv(foundPython)
} catch (err) { } catch (err) {
warning(`Failed to install pipx: ${(err as Error).toString()}. Ignoring...`) notice(`Failed to install pipx: ${(err as Error).toString()}. Ignoring...`)
} }
} }
@ -71,7 +71,7 @@ async function setupVenv(foundPython: string) {
try { try {
await setupPipPackWithPython(foundPython, "venv", undefined, { upgrade: false, usePipx: false }) await setupPipPackWithPython(foundPython, "venv", undefined, { upgrade: false, usePipx: false })
} catch (err) { } catch (err) {
warning(`Failed to install venv: ${(err as Error).toString()}. Ignoring...`) notice(`Failed to install venv: ${(err as Error).toString()}. Ignoring...`)
} }
} }
@ -85,7 +85,7 @@ async function setupWheel(foundPython: string) {
}) })
await setupPipPackWithPython(foundPython, "wheel", undefined, { upgrade: false, isLibrary: true, usePipx: false }) await setupPipPackWithPython(foundPython, "wheel", undefined, { upgrade: false, isLibrary: true, usePipx: false })
} catch (err) { } catch (err) {
warning(`Failed to install setuptools/wheel: ${(err as Error).toString()}. Ignoring...`) notice(`Failed to install setuptools/wheel: ${(err as Error).toString()}. Ignoring...`)
} }
} }

View File

@ -277,6 +277,10 @@ export function setupPipPackSystem(name: string, addPythonPrefix = true) {
return installAptPack([{ name: addPythonPrefix ? `python3-${name}` : name }]) return installAptPack([{ name: addPythonPrefix ? `python3-${name}` : name }])
} }
} else if (process.platform === "darwin") { } else if (process.platform === "darwin") {
if (["venv"].includes(name)) {
return null
}
return installBrewPack(name) return installBrewPack(name)
} }
return null return null