Skip to content

Commit 75454f9

Browse files
authored
Merge pull request #312 from aminya/update-versions [skip ci]
2 parents e0e749b + e77865a commit 75454f9

File tree

14 files changed

+293
-123
lines changed

14 files changed

+293
-123
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/legacy/versions.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"ninja":"1.12.1","cmake":"3.30.4","task":"3.39.2","powershell":"7.4.5","pip":">=22.2.0","python":">=3.7.9","meson":{"linux":{"ubuntu":{"20":"1.5.2","18":"0.61.4","else":"0.61.4"},"else":"1.5.2"},"else":"1.5.2"},"kcov":{"linux":{"ubuntu":{"22":"42-binary","20":"40-binary","14":"40","else":"42"},"else":"42"},"else":"42"},"doxygen":{"linux":{"archlinux":"1.12.0-2","ubuntu":{"22":"1.12.0","18":"1.10.0","else":"1.10.0"},"else":"1.12.0"},"else":"1.12.0"},"gcc":{"win32":"14.2.0posix-18.1.8-12.0.0-ucrt-r1","else":""},"mingw":{"win32":"14.2.0posix-18.1.8-12.0.0-ucrt-r1","linux":{"ubuntu":{"22":"8.0.0-1","20":"7.0.0-2","else":"7.0.0-2"},"else":""},"else":""},"gcovr":{"linux":{"ubuntu":{"20":"","18":"5.0","else":"5.0"},"else":""},"else":""},"nala":{"linux":{"ubuntu":{"22":"","21":"legacy","else":"legacy"},"else":""},"else":""},"llvm":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"18.1.8"},"clang":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"18.1.8"},"clang++":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"18.1.8"},"clang-tidy":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"18.1.8"},"clangtidy":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"18.1.8"},"clang-format":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"18.1.8"},"clangformat":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"18.1.8"}}

dist/modern/assets/actions_python-DZNSVoc3.mjs renamed to dist/modern/assets/actions_python-56soSduK.mjs

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

dist/modern/assets/actions_python-DZNSVoc3.mjs.map renamed to dist/modern/assets/actions_python-56soSduK.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.

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.

dist/modern/versions.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"ninja":"1.12.1","cmake":"3.30.4","task":"3.39.2","powershell":"7.4.5","pip":">=22.2.0","python":">=3.7.9","meson":{"linux":{"ubuntu":{"20":"1.5.2","18":"0.61.4","else":"0.61.4"},"else":"1.5.2"},"else":"1.5.2"},"kcov":{"linux":{"ubuntu":{"22":"42-binary","20":"40-binary","14":"40","else":"42"},"else":"42"},"else":"42"},"doxygen":{"linux":{"archlinux":"1.12.0-2","ubuntu":{"22":"1.12.0","18":"1.10.0","else":"1.10.0"},"else":"1.12.0"},"else":"1.12.0"},"gcc":{"win32":"14.2.0posix-18.1.8-12.0.0-ucrt-r1","else":""},"mingw":{"win32":"14.2.0posix-18.1.8-12.0.0-ucrt-r1","linux":{"ubuntu":{"22":"8.0.0-1","20":"7.0.0-2","else":"7.0.0-2"},"else":""},"else":""},"gcovr":{"linux":{"ubuntu":{"20":"","18":"5.0","else":"5.0"},"else":""},"else":""},"nala":{"linux":{"ubuntu":{"22":"","21":"legacy","else":"legacy"},"else":""},"else":""},"llvm":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"18.1.8"},"clang":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"18.1.8"},"clang++":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"18.1.8"},"clang-tidy":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"18.1.8"},"clangtidy":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"18.1.8"},"clang-format":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"18.1.8"},"clangformat":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"18.1.8"}}},"else":"18.1.8"}}

src/__tests__/main.test.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { parseArgs } from "../cli-options.js"
22
import { getCompilerInfo } from "../compilers.js"
33
import { type Inputs, llvmTools } from "../tool.js"
4-
import { DefaultUbuntuVersion, DefaultVersions } from "../versions/default_versions.js"
54
import { getVersion, syncVersions } from "../versions/versions.js"
65

76
jest.setTimeout(300000)
@@ -90,18 +89,13 @@ describe("getVersion", () => {
9089
it("gcovr", () => {
9190
expect(getVersion("gcovr", "5.0")).toBe("5.0")
9291
if (process.platform === "linux") {
93-
expect(getVersion("gcovr", "true", [22, 4])).toBe(DefaultUbuntuVersion.gcovr![22])
94-
expect(getVersion("gcovr", "true", [20, 4])).toBe(DefaultUbuntuVersion.gcovr![20])
95-
expect(getVersion("gcovr", "true", [18, 4])).toBe(DefaultUbuntuVersion.gcovr![18])
92+
expect(getVersion("gcovr", "true", [22, 4])).toBe("")
93+
expect(getVersion("gcovr", "true", [20, 4])).toBe("")
94+
expect(getVersion("gcovr", "true", [18, 4])).toBe("5.0")
9695
}
9796
})
9897

9998
it("llvm", () => {
10099
expect(getVersion("llvm", "13.0.0")).toBe("13.0.0")
101-
if (process.platform === "linux") {
102-
expect(getVersion("llvm", "true", [20, 4])).toBe(DefaultVersions.llvm)
103-
expect(getVersion("llvm", "true", [18, 4])).toBe(DefaultVersions.llvm)
104-
expect(getVersion("llvm", "true", [16, 4])).toBe(DefaultVersions.llvm)
105-
}
106100
})
107101
})

src/python/python.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import { setupPacmanPack } from "../utils/setup/setupPacmanPack.js"
2525
import { hasPipx, setupPipPackSystem, setupPipPackWithPython } from "../utils/setup/setupPipPack.js"
2626
import { isBinUptoDate } from "../utils/setup/version.js"
2727
import { unique } from "../utils/std/index.js"
28-
import { MinVersions } from "../versions/default_versions.js"
28+
import { getVersionDefault, isMinVersion } from "../versions/versions.js"
2929

3030
export async function setupPython(
3131
version: string,
@@ -89,7 +89,10 @@ async function setupWheel(foundPython: string) {
8989
}
9090
}
9191

92-
async function findOrSetupPython(version: string, setupDir: string, arch: string): Promise<InstallationInfo> {
92+
async function findOrSetupPython(givenVersion: string, setupDir: string, arch: string): Promise<InstallationInfo> {
93+
// if a version range specified, use the default version, and later check the range
94+
const version = isMinVersion(givenVersion) ? "" : givenVersion
95+
9396
let installInfo: InstallationInfo | undefined
9497
let foundPython = await findPython(setupDir)
9598

@@ -214,17 +217,19 @@ async function findPython(binDir?: string) {
214217

215218
async function isPythonUpToDate(candidate: string, binDir?: string) {
216219
try {
220+
const targetVersion = getVersionDefault("python")
221+
217222
if (binDir !== undefined) {
218223
const pythonBinPath = join(binDir, addExeExt(candidate))
219-
if (await pathExists(pythonBinPath) && await isBinUptoDate(pythonBinPath, MinVersions.python!)) {
224+
if (await pathExists(pythonBinPath) && await isBinUptoDate(pythonBinPath, targetVersion!)) {
220225
return pythonBinPath
221226
}
222227
}
223228
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
224229
const pythonBinPaths = (await which(candidate, { nothrow: true, all: true })) ?? []
225230
for (const pythonBinPath of pythonBinPaths) {
226231
// eslint-disable-next-line no-await-in-loop
227-
if (await isBinUptoDate(pythonBinPath, MinVersions.python!)) {
232+
if (await isBinUptoDate(pythonBinPath, targetVersion!)) {
228233
return pythonBinPath
229234
}
230235
}
@@ -260,11 +265,13 @@ async function findPip() {
260265

261266
async function isPipUptoDate(pip: string) {
262267
try {
268+
const targetVersion = getVersionDefault("pip")
269+
263270
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
264271
const pipPaths = (await which(pip, { nothrow: true, all: true })) ?? []
265272
for (const pipPath of pipPaths) {
266273
// eslint-disable-next-line no-await-in-loop
267-
if (await isBinUptoDate(pipPath, MinVersions.pip!)) {
274+
if (await isBinUptoDate(pipPath, targetVersion!)) {
268275
return pipPath
269276
}
270277
}

0 commit comments

Comments
 (0)