mirror of
https://github.com/actions/setup-python.git
synced 2025-04-19 19:33:29 +00:00
version is a string
This commit is contained in:
parent
0ed4f287d5
commit
f8d15403f8
2
dist/index.js
vendored
2
dist/index.js
vendored
@ -6718,7 +6718,7 @@ function binDir(installDir) {
|
|||||||
// For example, PyPy 7.3.2 contains Python 2.7, 3.6, and 3.7-alpha.
|
// For example, PyPy 7.3.2 contains Python 2.7, 3.6, and 3.7-alpha.
|
||||||
// We only care about the Python version, so we don't use the PyPy version for the tool cache.
|
// We only care about the Python version, so we don't use the PyPy version for the tool cache.
|
||||||
function usePyPy(version, architecture) {
|
function usePyPy(version, architecture) {
|
||||||
const findPyPy = tc.find.bind(undefined, 'PyPy', version.toString());
|
const findPyPy = tc.find.bind(undefined, 'PyPy', version);
|
||||||
let installDir = findPyPy(architecture);
|
let installDir = findPyPy(architecture);
|
||||||
if (!installDir && IS_WINDOWS) {
|
if (!installDir && IS_WINDOWS) {
|
||||||
// PyPy only precompiles binaries for x86, but the architecture parameter defaults to x64.
|
// PyPy only precompiles binaries for x86, but the architecture parameter defaults to x64.
|
||||||
|
@ -38,7 +38,7 @@ function binDir(installDir: string): string {
|
|||||||
// For example, PyPy 7.3.2 contains Python 2.7, 3.6, and 3.7-alpha.
|
// For example, PyPy 7.3.2 contains Python 2.7, 3.6, and 3.7-alpha.
|
||||||
// We only care about the Python version, so we don't use the PyPy version for the tool cache.
|
// We only care about the Python version, so we don't use the PyPy version for the tool cache.
|
||||||
function usePyPy(version: string, architecture: string): InstalledVersion {
|
function usePyPy(version: string, architecture: string): InstalledVersion {
|
||||||
const findPyPy = tc.find.bind(undefined, 'PyPy', version.toString());
|
const findPyPy = tc.find.bind(undefined, 'PyPy', version);
|
||||||
let installDir: string | null = findPyPy(architecture);
|
let installDir: string | null = findPyPy(architecture);
|
||||||
|
|
||||||
if (!installDir && IS_WINDOWS) {
|
if (!installDir && IS_WINDOWS) {
|
||||||
@ -189,12 +189,12 @@ export async function findPythonVersion(
|
|||||||
switch (version.toUpperCase()) {
|
switch (version.toUpperCase()) {
|
||||||
/* TODO: extract this into a function */
|
/* TODO: extract this into a function */
|
||||||
case 'PYPY2':
|
case 'PYPY2':
|
||||||
return usePyPy(2, architecture);
|
return usePyPy('2', architecture);
|
||||||
case 'PYPY3.6':
|
case 'PYPY3.6':
|
||||||
return usePyPy(3.6, architecture);
|
return usePyPy('3.6', architecture);
|
||||||
case 'PYPY3':
|
case 'PYPY3':
|
||||||
case 'PYPY3.7':
|
case 'PYPY3.7':
|
||||||
return usePyPy(3.7, architecture);
|
return usePyPy('3.7', architecture);
|
||||||
default:
|
default:
|
||||||
return await useCpythonVersion(version, architecture);
|
return await useCpythonVersion(version, architecture);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user