mirror of
https://github.com/actions/setup-python.git
synced 2025-04-24 15:32:13 +00:00
Allow pypyX.Y
This commit is contained in:
parent
e621a16884
commit
070ce4509c
4 changed files with 33 additions and 12 deletions
2
.github/workflows/test-pypy.yml
vendored
2
.github/workflows/test-pypy.yml
vendored
|
@ -22,6 +22,7 @@ jobs:
|
||||||
pypy:
|
pypy:
|
||||||
- 'pypy-2.7'
|
- 'pypy-2.7'
|
||||||
- 'pypy-3.7'
|
- 'pypy-3.7'
|
||||||
|
- 'pypy3.9'
|
||||||
- 'pypy-2.7-v7.3.4'
|
- 'pypy-2.7-v7.3.4'
|
||||||
- 'pypy-3.7-v7.3.5'
|
- 'pypy-3.7-v7.3.5'
|
||||||
- 'pypy-3.7-v7.3.4'
|
- 'pypy-3.7-v7.3.4'
|
||||||
|
@ -29,6 +30,7 @@ jobs:
|
||||||
- 'pypy-3.7-v7.x'
|
- 'pypy-3.7-v7.x'
|
||||||
- 'pypy-2.7-v7.3.4rc1'
|
- 'pypy-2.7-v7.3.4rc1'
|
||||||
- 'pypy-3.7-nightly'
|
- 'pypy-3.7-nightly'
|
||||||
|
- 'pypy3.8-v7.3.7'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
|
|
22
dist/setup/index.js
vendored
22
dist/setup/index.js
vendored
|
@ -2128,14 +2128,24 @@ function findPyPyToolCache(pythonVersion, pypyVersion, architecture) {
|
||||||
}
|
}
|
||||||
exports.findPyPyToolCache = findPyPyToolCache;
|
exports.findPyPyToolCache = findPyPyToolCache;
|
||||||
function parsePyPyVersion(versionSpec) {
|
function parsePyPyVersion(versionSpec) {
|
||||||
const versions = versionSpec.split('-').filter(item => !!item);
|
let versionsString;
|
||||||
if (versions.length < 2 || versions[0] != 'pypy') {
|
if (versionSpec.length > 4 && versionSpec[4] == '-') {
|
||||||
|
versionsString = versionSpec.slice(5);
|
||||||
|
}
|
||||||
|
else if (versionSpec.length > 3) {
|
||||||
|
versionsString = versionSpec.slice(4);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
versionsString = '';
|
||||||
|
}
|
||||||
|
const versions = versionsString.split('-').filter(item => !!item);
|
||||||
|
if (!versionSpec.startsWith('pypy') || versions.length == 0) {
|
||||||
throw new Error("Invalid 'version' property for PyPy. PyPy version should be specified as 'pypy-<python-version>'. See README for examples and documentation.");
|
throw new Error("Invalid 'version' property for PyPy. PyPy version should be specified as 'pypy-<python-version>'. See README for examples and documentation.");
|
||||||
}
|
}
|
||||||
const pythonVersion = versions[1];
|
const pythonVersion = versions[0];
|
||||||
let pypyVersion;
|
let pypyVersion;
|
||||||
if (versions.length > 2) {
|
if (versions.length > 1) {
|
||||||
pypyVersion = pypyInstall.pypyVersionToSemantic(versions[2]);
|
pypyVersion = pypyInstall.pypyVersionToSemantic(versions[1]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
pypyVersion = 'x';
|
pypyVersion = 'x';
|
||||||
|
@ -6684,7 +6694,7 @@ const os = __importStar(__webpack_require__(87));
|
||||||
const cache_factory_1 = __webpack_require__(633);
|
const cache_factory_1 = __webpack_require__(633);
|
||||||
const utils_1 = __webpack_require__(163);
|
const utils_1 = __webpack_require__(163);
|
||||||
function isPyPyVersion(versionSpec) {
|
function isPyPyVersion(versionSpec) {
|
||||||
return versionSpec.startsWith('pypy-');
|
return versionSpec.startsWith('pypy');
|
||||||
}
|
}
|
||||||
function cacheDependencies(cache, pythonVersion) {
|
function cacheDependencies(cache, pythonVersion) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
|
|
@ -118,18 +118,27 @@ export function findPyPyToolCache(
|
||||||
}
|
}
|
||||||
|
|
||||||
export function parsePyPyVersion(versionSpec: string): IPyPyVersionSpec {
|
export function parsePyPyVersion(versionSpec: string): IPyPyVersionSpec {
|
||||||
const versions = versionSpec.split('-').filter(item => !!item);
|
let versionsString: string;
|
||||||
|
if (versionSpec.length > 4 && versionSpec[4] == '-') {
|
||||||
|
versionsString = versionSpec.slice(5);
|
||||||
|
} else if (versionSpec.length > 3) {
|
||||||
|
versionsString = versionSpec.slice(4);
|
||||||
|
} else {
|
||||||
|
versionsString = '';
|
||||||
|
}
|
||||||
|
|
||||||
if (versions.length < 2 || versions[0] != 'pypy') {
|
const versions = versionsString.split('-').filter(item => !!item);
|
||||||
|
|
||||||
|
if (!versionSpec.startsWith('pypy') || versions.length == 0) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
"Invalid 'version' property for PyPy. PyPy version should be specified as 'pypy-<python-version>'. See README for examples and documentation."
|
"Invalid 'version' property for PyPy. PyPy version should be specified as 'pypy-<python-version>'. See README for examples and documentation."
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const pythonVersion = versions[1];
|
const pythonVersion = versions[0];
|
||||||
let pypyVersion: string;
|
let pypyVersion: string;
|
||||||
if (versions.length > 2) {
|
if (versions.length > 1) {
|
||||||
pypyVersion = pypyInstall.pypyVersionToSemantic(versions[2]);
|
pypyVersion = pypyInstall.pypyVersionToSemantic(versions[1]);
|
||||||
} else {
|
} else {
|
||||||
pypyVersion = 'x';
|
pypyVersion = 'x';
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ import {getCacheDistributor} from './cache-distributions/cache-factory';
|
||||||
import {isGhes} from './utils';
|
import {isGhes} from './utils';
|
||||||
|
|
||||||
function isPyPyVersion(versionSpec: string) {
|
function isPyPyVersion(versionSpec: string) {
|
||||||
return versionSpec.startsWith('pypy-');
|
return versionSpec.startsWith('pypy');
|
||||||
}
|
}
|
||||||
|
|
||||||
async function cacheDependencies(cache: string, pythonVersion: string) {
|
async function cacheDependencies(cache: string, pythonVersion: string) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue