fix: 3.x-dev can install a 3.y version#417
Conversation
@vsafonkin, |
|
@mayeut, I mean |
|
It was clear for me with If what the patch is doing is unclear using import * as semver from 'semver';
function check(version: string, range: string) {
const statified = semver.satisfies(version, range);
const expected = semver.satisfies(version, "~3.10.0-0", {includePrerelease: true});
if (expected !== statified) {
console.error(`FAIL: ${version} statifies ${range} returned ${statified}, expected ${expected}`)
}
else {
console.log(`PASS: ${version} statifies ${range} returned ${statified}, expected ${expected}`)
}
}
for (const range of [">= 3.10.0-a0", "~3.10.0-0"]) {
for (const version of ["3.9.9", "3.10.0-alpha.1", "3.10.0", "3.10.1-alpha.1", "3.10.1", "3.11.0-alpha.1", "3.11.0"]) {
check(version, range);
}
}before PR ( with the PR ( |
|
@mayeut, great, thank you! |
* fix: 3.x-dev can install a 3.y version * Update README section for `-dev`
Description:
Rework
desugarDevVersionso that3.x-devcannot end up with3.y/4.xinstalled.It still does not do what one would expect (include pre-release even if there's a stable release - would require actions/toolkit#709 to be fixed) but it was already the case & python-versions does not build pre-releases for minor versions once a stable release exists, so it does not matter much (but going with mitigates rather than fix below).
Related issue:
mitigates #416
Check list: