mirror of
https://github.com/actions/setup-python.git
synced 2025-04-21 22:38:43 +00:00
removed logs, added multiarch support for toolcache
This commit is contained in:
parent
401fc93a1b
commit
6767fd0bec
4 changed files with 55 additions and 35 deletions
|
@ -96,38 +96,38 @@
|
|||
"latest_pypy": false,
|
||||
"date": "2021-03-19",
|
||||
"files": [
|
||||
{
|
||||
"filename": "pypy2.7-v7.3.4rc1-aarch64.tar.bz2",
|
||||
"arch": "aarch64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://test.downloads.python.org/pypy/pypy2.7-v7.3.4rc1-aarch64.tar.bz2"
|
||||
},
|
||||
{
|
||||
"filename": "pypy2.7-v7.3.4rc1-linux32.tar.bz2",
|
||||
"arch": "i686",
|
||||
"platform": "linux",
|
||||
"download_url": "https://test.downloads.python.org/pypy/pypy2.7-v7.3.4rc1-linux32.tar.bz2"
|
||||
},
|
||||
{
|
||||
"filename": "pypy2.7-v7.3.4rc1-linux64.tar.bz2",
|
||||
"arch": "x64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://test.downloads.python.org/pypy/pypy2.7-v7.3.4rc1-linux64.tar.bz2"
|
||||
},
|
||||
{
|
||||
"filename": "pypy2.7-v7.3.4rc1-osx64.tar.bz2",
|
||||
"arch": "x64",
|
||||
"platform": "darwin",
|
||||
"download_url": "https://test.downloads.python.org/pypy/pypy2.7-v7.3.4rc1-osx64.tar.bz2"
|
||||
},
|
||||
{
|
||||
"filename": "pypy2.7-v7.3.4rc1-win64.zip",
|
||||
"arch": "x64",
|
||||
"platform": "win64",
|
||||
"download_url": "https://test.downloads.python.org/pypy/pypy2.7-v7.3.4rc1-win64.zip"
|
||||
}
|
||||
{
|
||||
"filename": "pypy2.7-v7.3.4rc1-aarch64.tar.bz2",
|
||||
"arch": "aarch64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://test.downloads.python.org/pypy/pypy2.7-v7.3.4rc1-aarch64.tar.bz2"
|
||||
},
|
||||
{
|
||||
"filename": "pypy2.7-v7.3.4rc1-linux32.tar.bz2",
|
||||
"arch": "i686",
|
||||
"platform": "linux",
|
||||
"download_url": "https://test.downloads.python.org/pypy/pypy2.7-v7.3.4rc1-linux32.tar.bz2"
|
||||
},
|
||||
{
|
||||
"filename": "pypy2.7-v7.3.4rc1-linux64.tar.bz2",
|
||||
"arch": "x64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://test.downloads.python.org/pypy/pypy2.7-v7.3.4rc1-linux64.tar.bz2"
|
||||
},
|
||||
{
|
||||
"filename": "pypy2.7-v7.3.4rc1-osx64.tar.bz2",
|
||||
"arch": "x64",
|
||||
"platform": "darwin",
|
||||
"download_url": "https://test.downloads.python.org/pypy/pypy2.7-v7.3.4rc1-osx64.tar.bz2"
|
||||
},
|
||||
{
|
||||
"filename": "pypy2.7-v7.3.4rc1-win64.zip",
|
||||
"arch": "x64",
|
||||
"platform": "win64",
|
||||
"download_url": "https://test.downloads.python.org/pypy/pypy2.7-v7.3.4rc1-win64.zip"
|
||||
}
|
||||
]
|
||||
},
|
||||
},
|
||||
{
|
||||
"pypy_version": "7.3.3rc2",
|
||||
"python_version": "3.7.7",
|
||||
|
|
11
dist/index.js
vendored
11
dist/index.js
vendored
|
@ -1133,7 +1133,9 @@ exports.findPyPyVersion = findPyPyVersion;
|
|||
function findPyPyToolCache(pythonVersion, pypyVersion, architecture) {
|
||||
let resolvedPyPyVersion = '';
|
||||
let resolvedPythonVersion = '';
|
||||
let installDir = tc.find('PyPy', pythonVersion, architecture);
|
||||
let installDir = utils_1.IS_WINDOWS
|
||||
? findPyPyInstallDirForWindows(pythonVersion)
|
||||
: tc.find('PyPy', pythonVersion, architecture);
|
||||
if (installDir) {
|
||||
// 'tc.find' finds tool based on Python version but we also need to check
|
||||
// whether PyPy version satisfies requested version.
|
||||
|
@ -1177,6 +1179,12 @@ function parsePyPyVersion(versionSpec) {
|
|||
};
|
||||
}
|
||||
exports.parsePyPyVersion = parsePyPyVersion;
|
||||
function findPyPyInstallDirForWindows(pythonVersion) {
|
||||
let installDir = '';
|
||||
utils_1.WINDOWS_ARCHS.forEach(architecture => (installDir = installDir || tc.find('PyPy', pythonVersion, architecture)));
|
||||
return installDir;
|
||||
}
|
||||
exports.findPyPyInstallDirForWindows = findPyPyInstallDirForWindows;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
@ -2933,7 +2941,6 @@ function pypyVersionToSemantic(versionSpec) {
|
|||
}
|
||||
exports.pypyVersionToSemantic = pypyVersionToSemantic;
|
||||
function isArchPresentForWindows(item) {
|
||||
core.info(JSON.stringify(item));
|
||||
return item.files.some((file) => utils_1.WINDOWS_ARCHS.includes(file.arch) &&
|
||||
utils_1.WINDOWS_PLATFORMS.includes(file.platform));
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ import * as path from 'path';
|
|||
import * as pypyInstall from './install-pypy';
|
||||
import {
|
||||
IS_WINDOWS,
|
||||
WINDOWS_ARCHS,
|
||||
validateVersion,
|
||||
getPyPyVersionFromPath,
|
||||
readExactPyPyVersionFile,
|
||||
|
@ -67,7 +68,9 @@ export function findPyPyToolCache(
|
|||
) {
|
||||
let resolvedPyPyVersion = '';
|
||||
let resolvedPythonVersion = '';
|
||||
let installDir: string | null = tc.find('PyPy', pythonVersion, architecture);
|
||||
let installDir: string | null = IS_WINDOWS
|
||||
? findPyPyInstallDirForWindows(pythonVersion)
|
||||
: tc.find('PyPy', pythonVersion, architecture);
|
||||
|
||||
if (installDir) {
|
||||
// 'tc.find' finds tool based on Python version but we also need to check
|
||||
|
@ -129,3 +132,14 @@ export function parsePyPyVersion(versionSpec: string): IPyPyVersionSpec {
|
|||
pythonVersion: pythonVersion
|
||||
};
|
||||
}
|
||||
|
||||
export function findPyPyInstallDirForWindows(pythonVersion: string): string {
|
||||
let installDir = '';
|
||||
|
||||
WINDOWS_ARCHS.forEach(
|
||||
architecture =>
|
||||
(installDir = installDir || tc.find('PyPy', pythonVersion, architecture))
|
||||
);
|
||||
|
||||
return installDir;
|
||||
}
|
||||
|
|
|
@ -195,7 +195,6 @@ export function pypyVersionToSemantic(versionSpec: string) {
|
|||
}
|
||||
|
||||
export function isArchPresentForWindows(item: any) {
|
||||
core.info(JSON.stringify(item));
|
||||
return item.files.some(
|
||||
(file: any) =>
|
||||
WINDOWS_ARCHS.includes(file.arch) &&
|
||||
|
|
Loading…
Add table
Reference in a new issue