Skip to content
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

Support pre-release packages with floating versions. Version="*-*" and similar. #912

Closed
pranavkm opened this issue Jul 9, 2015 · 100 comments · Fixed by NuGet/NuGet.Client#3247
Assignees
Labels
Functionality:Restore Priority:1 High priority issues that must be resolved in the current sprint. Style:PackageReference Type:Feature

Comments

@pranavkm
Copy link
Contributor

pranavkm commented Jul 9, 2015

UPDATE: final solution details

Original Issue:
Consider a project.json specification such as

{
   "A: "1.0.*"
}

If the only packages in the feed are prerelease packages such as A.1.0.0-alpha, A.1.0.1-beta, the restore fails stating it was unable to resolve package A.


[anangaur] Adding the requirement as evolved during the discussions:

As Noel, who uses NuGet packages in PackageReference based projects,

  • I would like to use floating versions that only resolves to stable versions of the package (Current behavior)
  • I would like to use floating version that can resolve to the latest version even if the latest happens to be a pre-release version.
  • I should be able to use both the braces/regex formats i.e. 1.* or [1.0.0, 2.0.0) that can include pre-release versions
  • I would like to additionally define whether I want to resolve to rc, beta, alpha or all pre-releases.

Link to spec - https://github.com/NuGet/Home/wiki/Support-pre-release-packages-with-floating-versions
Status - Implemented in version 5.6 of NuGet, 16.6 of Visual Studio and 3.1.300 of the .NET Core SDK.

@yishaigalatzer yishaigalatzer added this to the 3.2.0-Beta milestone Jul 9, 2015
@yishaigalatzer
Copy link

We can discuss this for 3.2

@yishaigalatzer yishaigalatzer added Type:DCR Design Change Request and removed Type:Bug labels Jul 9, 2015
@yishaigalatzer
Copy link

I looked at how NPM does it, and it looks like it will not allow pre-releases with such a specifier.

We need to work on how we extend our syntax to support ranges (do we go with something similar to npm? Do we also allow 1.*-*? Do we allow for version ranges ala packages.config/nuspec?

@yishaigalatzer yishaigalatzer modified the milestones: 3.4, 3.3.0-Beta Nov 23, 2015
@yishaigalatzer yishaigalatzer added the Priority:2 Issues for the current backlog. label Nov 23, 2015
@pranavkm
Copy link
Contributor Author

Do we also allow 1.-

AFAIK it stops when it sees the *. @emgarten would know this better.

@yishaigalatzer
Copy link

Yes it does, my comment was a question about what we should do in the future :)

@yishaigalatzer yishaigalatzer modified the milestones: 3.4 Beta, 3.4 RTM Feb 25, 2016
@yishaigalatzer yishaigalatzer modified the milestones: 3.4 RTM, 3.4 RTM - Triage, 3.5 Beta Mar 11, 2016
@yishaigalatzer yishaigalatzer modified the milestones: 3.5 Beta, 3.5 RC Apr 8, 2016
@CZEMacLeod
Copy link

Wondering if there is any progress on this as for CI purposes it would really help us to support 7.0.*-* or something like

{
      "version": "7.0.*",
      "prerelease": true
}

@yishaigalatzer
Copy link

Not yet, a good indication of progress would be if the item is assigned to someone for work.

@CZEMacLeod
Copy link

Unfortunately that's what I thought... Just been open for over a year and bumped again and again... :(

@anangaur
Copy link
Member

Update: This work has been scheduled.

@karann-msft
Copy link
Contributor

Update - here is a link to the spec - https://github.com/NuGet/Home/wiki/Support-pre-release-packages-with-floating-versions

We will continue to use this issue for feedback.

@nkolev92
Copy link
Member

Pull Request out based on the above linked design NuGet/NuGet.Client#3247.

@jgalarse
Copy link

Hi all, I saw that the "Support pre-release packages with floating versions" changes are implement in the 5.6.0 nuget version and I tried the latest 5.6.0 preview2 version but the floating version format "-" is still considered as an invalid version format.

Am i missing something? Or do i have to wait for the full 5.6.0 release?

Visual Studio 2019 16.5.4
Nuget 5.6.0 Preview2

@anangaur
Copy link
Member

anangaur commented Apr 16, 2020

@nkolev92 can you point to the version of the tools where this works?

@nkolev92
Copy link
Member

It will be a part of the 5.6 release/16.6 of Visual Studio.

It will be in preview 3 of both which is supposed to ship next week.

@jgalarse
Copy link

@anangaur ,@nkolev92 Thank you so much!!

@rrelyea rrelyea changed the title Support pre-release packages with floating versions Support pre-release packages with floating versions. Version = "*-*" and similar. May 19, 2020
@rrelyea rrelyea changed the title Support pre-release packages with floating versions. Version = "*-*" and similar. Support pre-release packages with floating versions. Version="*-*" and similar. May 19, 2020
@rrelyea rrelyea added Type:Feature and removed Type:DCR Design Change Request labels May 21, 2020
@sm-g
Copy link

sm-g commented Jul 8, 2020

@nkolev92 Are versions like (,1.3.*] supported? NuGet.CommandLine 5.6 can not restore csproj with such version.

@nkolev92
Copy link
Member

nkolev92 commented Jul 8, 2020

@sm-g Floating versions are only allowed in the min part of the range, they cannot be part of the upper bound, so your example version range is not supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment