Skip to content

Commit 2428548

Browse files
committed
fix: fix venv check for ubuntu 20
1 parent ae4905b commit 2428548

File tree

5 files changed

+11
-5
lines changed

5 files changed

+11
-5
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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { readdir } from "fs/promises"
1212
import memoize from "memoizee"
1313
import { pathExists } from "path-exists"
1414
import { addExeExt } from "patha"
15-
import { installAptPack } from "setup-apt"
15+
import { installAptPack, isAptPackInstalled } from "setup-apt"
1616
import { installBrewPack } from "setup-brew"
1717
import which from "which"
1818
import { rcOptions } from "../cli-options.js"
@@ -122,6 +122,12 @@ async function hasVenv(foundPython: string): Promise<boolean> {
122122
try {
123123
// check if venv module exits
124124
await execa(foundPython, ["-m", "venv", "-h"], { stdio: "ignore" })
125+
126+
// checking venv module is not enough on Ubuntu 20.04
127+
if (isUbuntu()) {
128+
return isAptPackInstalled("python3-venv")
129+
}
130+
125131
return true
126132
} catch {
127133
// if module not found, continue

0 commit comments

Comments
 (0)