@@ -6694,7 +6694,7 @@ function run() {
6694
6694
core.info(`Successfully setup PyPy ${installed.resolvedPyPyVersion} with Python (${installed.resolvedPythonVersion})`);
6695
6695
}
6696
6696
else {
6697
- const installed = yield finder.findPythonVersion (version, arch);
6697
+ const installed = yield finder.useCpythonVersion (version, arch);
6698
6698
pythonVersion = installed.version;
6699
6699
core.info(`Successfully setup ${installed.impl} (${pythonVersion})`);
6700
6700
}
@@ -57111,7 +57111,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
57111
57111
});
57112
57112
};
57113
57113
Object.defineProperty(exports, "__esModule", { value: true });
57114
- exports.findPythonVersion = exports.pythonVersionToSemantic = void 0;
57114
+ exports.pythonVersionToSemantic = exports.useCpythonVersion = void 0;
57115
57115
const os = __importStar(__webpack_require__(87));
57116
57116
const path = __importStar(__webpack_require__(622));
57117
57117
const utils_1 = __webpack_require__(163);
@@ -57139,40 +57139,6 @@ function binDir(installDir) {
57139
57139
return path.join(installDir, 'bin');
57140
57140
}
57141
57141
}
57142
- // Note on the tool cache layout for PyPy:
57143
- // PyPy has its own versioning scheme that doesn't follow the Python versioning scheme.
57144
- // A particular version of PyPy may contain one or more versions of the Python interpreter.
57145
- // For example, PyPy 7.0 contains Python 2.7, 3.5, and 3.6-alpha.
57146
- // We only care about the Python version, so we don't use the PyPy version for the tool cache.
57147
- function usePyPy(majorVersion, architecture) {
57148
- const findPyPy = tc.find.bind(undefined, 'PyPy', majorVersion);
57149
- let installDir = findPyPy(architecture);
57150
- if (!installDir && utils_1.IS_WINDOWS) {
57151
- // PyPy only precompiles binaries for x86, but the architecture parameter defaults to x64.
57152
- // On our Windows virtual environments, we only install an x86 version.
57153
- // Fall back to x86.
57154
- installDir = findPyPy('x86');
57155
- }
57156
- if (!installDir) {
57157
- // PyPy not installed in $(Agent.ToolsDirectory)
57158
- throw new Error(`PyPy ${majorVersion} not found`);
57159
- }
57160
- // For PyPy, Windows uses 'bin', not 'Scripts'.
57161
- const _binDir = path.join(installDir, 'bin');
57162
- // On Linux and macOS, the Python interpreter is in 'bin'.
57163
- // On Windows, it is in the installation root.
57164
- const pythonLocation = utils_1.IS_WINDOWS ? installDir : _binDir;
57165
- core.exportVariable('pythonLocation', pythonLocation);
57166
- core.addPath(installDir);
57167
- core.addPath(_binDir);
57168
- // Starting from PyPy 7.3.1, the folder that is used for pip and anything that pip installs should be "Scripts" on Windows.
57169
- if (utils_1.IS_WINDOWS) {
57170
- core.addPath(path.join(installDir, 'Scripts'));
57171
- }
57172
- const impl = 'pypy' + majorVersion.toString();
57173
- core.setOutput('python-version', impl);
57174
- return { impl: impl, version: versionFromPath(installDir) };
57175
- }
57176
57142
function useCpythonVersion(version, architecture) {
57177
57143
return __awaiter(this, void 0, void 0, function* () {
57178
57144
const desugaredVersionSpec = desugarDevVersion(version);
@@ -57222,6 +57188,7 @@ function useCpythonVersion(version, architecture) {
57222
57188
return { impl: 'CPython', version: installed };
57223
57189
});
57224
57190
}
57191
+ exports.useCpythonVersion = useCpythonVersion;
57225
57192
/** Convert versions like `3.8-dev` to a version like `>= 3.8.0-a0`. */
57226
57193
function desugarDevVersion(versionSpec) {
57227
57194
if (versionSpec.endsWith('-dev')) {
@@ -57248,20 +57215,6 @@ function pythonVersionToSemantic(versionSpec) {
57248
57215
return versionSpec.replace(prereleaseVersion, '$1-$2');
57249
57216
}
57250
57217
exports.pythonVersionToSemantic = pythonVersionToSemantic;
57251
- function findPythonVersion(version, architecture) {
57252
- return __awaiter(this, void 0, void 0, function* () {
57253
- switch (version.toUpperCase()) {
57254
- case 'PYPY2':
57255
- return usePyPy('2', architecture);
57256
- case 'PYPY3':
57257
- // keep pypy3 pointing to 3.6 for backward compatibility
57258
- return usePyPy('3.6', architecture);
57259
- default:
57260
- return yield useCpythonVersion(version, architecture);
57261
- }
57262
- });
57263
- }
57264
- exports.findPythonVersion = findPythonVersion;
57265
57218
57266
57219
57267
57220
/***/ }),
0 commit comments