Repository navigation
Resolve NuGet floating versions and ranges the way restore does - #126
Merged
Merged
Conversation
A #r "nuget:" reference whose version was not an exact version fell through to "latest stable", so *-* never picked up a prerelease, 1.* could resolve to a newer major, and the bounds of a range such as [1.0.0,2.0.0) were ignored. All of it happened silently. Versions are now chosen in three ways. No version still means the latest stable release. A plain version is still an exact pin. Anything else is read as a NuGet version range and resolved with VersionRange.FindBestMatch: a floating version takes the highest match, including prereleases only when it asks for them, and a bounded range takes the lowest version it allows, as dotnet restore does. A version that cannot be read is now an error instead of quietly becoming the latest stable. The same change goes into the F# fallback resolver, with the new error message localized. The README and the Polyglot migration guide now show the right syntax and describe how versions resolve. Fixes #124 Signed-off-by: Torrey Betts <[email protected]>
SummarySummary
CoverageVerso - 82.2%
Verso.Abstractions - 84.2%
Verso.Ado - 81.4%
Verso.Blazor - 31.4%
Verso.Blazor.Shared - 62.6%
Verso.Cli - 41.4%
Verso.DataFrame - 82.3%
Verso.FSharp - 81.9%
Verso.Host - 57.4%
Verso.Http - 76.2%
Verso.JavaScript - 59.8%
Verso.PowerShell - 64.7%
Verso.Python - 78.1%
Verso.Sample.Diagram - 80.1%
Verso.Sample.Dice - 82.2%
Verso.Sample.Slides - 58.8%
Verso.Sample.Sparkline - 67.3%
Verso.Testing - 79.4%
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #124.
A
#r "nuget:"reference whose version wasn't an exact version fell through to "latest stable". That was meant only for a reference with no version, but it caught every floating version and range too, and gave no warning:*-*1.*1.0.0-*[1.0.0,2.0.0)(,1.5.0]1.0.0.xTwo cases are unchanged on purpose. No version, or
*, still picks the latest stable release. A plain version is still an exact pin. NuGet reads a plain version as a minimum, but Verso has always pinned it.Anything else goes through
VersionRange.TryParseandFindBestMatchfrom NuGet.Versioning, which already ships with NuGet.Protocol. A bounded range picks the lowest version it allows, the same asdotnet restore. The change is in the C# resolver and in the F# fallback resolver. The F# error message is localized.The marketplace install path still accepts only exact versions, and the extension consent check still looks only at stable releases.
The README showed
#r "nuget: PackageName/Version", which the parser doesn't accept. It now showsPackageName, Versionand explains how versions resolve. The Polyglot migration guide notes that a plain version is an exact pin in Verso.Tests cover each row above, plus exact prerelease pins and ranges written with a comma, with and without a space after it.
Behavior change: a notebook with a version Verso can't read used to get the latest stable release without any warning. Now its cell fails with an error that names the version.