-
Notifications
You must be signed in to change notification settings - Fork 549
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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! |
Description:
Rework
desugarDevVersion
so that3.x-dev
cannot end up with3.y
/4.x
installed.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: