mirror of
https://github.com/actions/setup-python.git
synced 2025-06-13 07:47:12 +02:00
update pypy3 to point to 3.6 (#164)
This commit is contained in:
13
dist/index.js
vendored
13
dist/index.js
vendored
@ -6445,7 +6445,7 @@ function installPython(workingDirectory) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const options = {
|
||||
cwd: workingDirectory,
|
||||
env: Object.assign(Object.assign({}, process.env), IS_LINUX && { 'LD_LIBRARY_PATH': path.join(workingDirectory, 'lib') }),
|
||||
env: Object.assign(Object.assign({}, process.env), (IS_LINUX && { LD_LIBRARY_PATH: path.join(workingDirectory, 'lib') })),
|
||||
silent: true,
|
||||
listeners: {
|
||||
stdout: (data) => {
|
||||
@ -6718,7 +6718,7 @@ function binDir(installDir) {
|
||||
// For example, PyPy 7.0 contains Python 2.7, 3.5, and 3.6-alpha.
|
||||
// We only care about the Python version, so we don't use the PyPy version for the tool cache.
|
||||
function usePyPy(majorVersion, architecture) {
|
||||
const findPyPy = tc.find.bind(undefined, 'PyPy', majorVersion.toString());
|
||||
const findPyPy = tc.find.bind(undefined, 'PyPy', majorVersion);
|
||||
let installDir = findPyPy(architecture);
|
||||
if (!installDir && IS_WINDOWS) {
|
||||
// PyPy only precompiles binaries for x86, but the architecture parameter defaults to x64.
|
||||
@ -6765,7 +6765,9 @@ function useCpythonVersion(version, architecture) {
|
||||
}
|
||||
core.exportVariable('pythonLocation', installDir);
|
||||
if (IS_LINUX) {
|
||||
const libPath = (process.env.LD_LIBRARY_PATH) ? `:${process.env.LD_LIBRARY_PATH}` : '';
|
||||
const libPath = process.env.LD_LIBRARY_PATH
|
||||
? `:${process.env.LD_LIBRARY_PATH}`
|
||||
: '';
|
||||
const pyLibPath = path.join(installDir, 'lib');
|
||||
if (!libPath.split(':').includes(pyLibPath)) {
|
||||
core.exportVariable('LD_LIBRARY_PATH', pyLibPath + libPath);
|
||||
@ -6819,9 +6821,10 @@ function findPythonVersion(version, architecture) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
switch (version.toUpperCase()) {
|
||||
case 'PYPY2':
|
||||
return usePyPy(2, architecture);
|
||||
return usePyPy('2', architecture);
|
||||
case 'PYPY3':
|
||||
return usePyPy(3, architecture);
|
||||
// keep pypy3 pointing to 3.6 for backward compatibility
|
||||
return usePyPy('3.6', architecture);
|
||||
default:
|
||||
return yield useCpythonVersion(version, architecture);
|
||||
}
|
||||
|
Reference in New Issue
Block a user