fix: 3.x-dev can install a 3.y version

This commit is contained in:
mayeut 2022-06-05 13:33:10 +02:00
parent 53e15292cd
commit 969d5a9af2
No known key found for this signature in database
GPG key ID: 8B03CED67D3ABFBA
3 changed files with 34 additions and 16 deletions

11
dist/setup/index.js vendored
View file

@ -64183,15 +64183,10 @@ function useCpythonVersion(version, architecture) {
});
}
exports.useCpythonVersion = useCpythonVersion;
/** Convert versions like `3.8-dev` to a version like `>= 3.8.0-a0`. */
/** Convert versions like `3.8-dev` to a version like `~3.8.0-0`. */
function desugarDevVersion(versionSpec) {
if (versionSpec.endsWith('-dev')) {
const versionRoot = versionSpec.slice(0, -'-dev'.length);
return `>= ${versionRoot}.0-a0`;
}
else {
return versionSpec;
}
const devVersion = /^(\d+)\.(\d+)-dev$/;
return versionSpec.replace(devVersion, '~$1.$2.0-0');
}
/** Extracts python version from install path from hosted tool cache as described in README.md */
function versionFromPath(installDir) {