choco icon indicating copy to clipboard operation
choco copied to clipboard

Support Semantic Versioning 2.0.0 (semver)

Open watashiSHUN opened this issue 6 years ago • 15 comments

what version of nuget is chocolatey using? looking at NuGet.exe under .nuget/, I am getting 1.7.0 which is pretty ancient. Anyway, right now I can not pack with version number following SemVer2.0.0: image

but this is supported in nuget4.3.0+: image

watashiSHUN avatar Jul 06 '18 00:07 watashiSHUN

@https://github.com/chocolatey/choco/issues/1528

watashiSHUN avatar Jul 06 '18 00:07 watashiSHUN

Since this hasn't been officially answered. I'll unofficially answer it.

Deducing from "https://chocolatey.org/api/v2/" I'd say Chocolatey is still using nuget v2.

@ferventcoder has some comments somewhere (paraphrasing) saying that nuget v3 is not in a finished state yet. (Don't know if it still holds true as of today.)

bcurran3 avatar Jul 28 '18 04:07 bcurran3

@watashiSHUN Chocolatey != NuGet. Chocolatey uses NuGet and enhances, but the two are not quite equal in terms of what they support. We are working on supporting SemVer v2 though, and we hoped to have it ready in 0.10.11. @bcurran3 is correct that Chocolatey has enhancements on top of NuGet v2 - we have it on the roadmap to move to NuGet vNewer, but it's not the easiest upgrade to support as it is not a 1:1, so we want to have all of the different things for testing infra in place prior to the upgrade to catch any unexpected issues.

ferventcoder avatar Sep 26 '18 03:09 ferventcoder

Added this to the backlog, I thought we actually had an issue in here somewhere but I was unable to locate it. Thanks for writing that up!

ferventcoder avatar Sep 26 '18 03:09 ferventcoder

@ferventcoder, do you have an idea when this might come? Would a PR help? I'm interested in it for 2 reasons:

  1. I have some packages that would benefit from it
  2. I need to patch AU to make it SemVer 2 aware as soon as choco is

Thanks

Thilas avatar Jan 15 '19 07:01 Thilas

@Thilas while this would get into Chocolatey itself in vNext, it will also need to be added to Chocolatey.org to work up there. I wonder if we have an issue on it up there yet?

ferventcoder avatar Jan 18 '19 02:01 ferventcoder

@ferventcoder, what do you mean? That we can already test it on choco itself? Is there anything I can do to help?

Thilas avatar Jan 22 '19 19:01 Thilas

Does getting to semver 2.0.0 require upgrading nuget? if so, is there a clear list of issues to get there?

kijanawoodard avatar Nov 22 '19 22:11 kijanawoodard

Is there any timeline for the this will be included?

JRSerjeant avatar Jun 26 '20 08:06 JRSerjeant

We have a hoped timeline, but it needs to make the cut for releasing bits. Then we'll need to make changes to support it on Chocolatey.org as well.

ferventcoder avatar Jul 01 '20 01:07 ferventcoder

Has anyone worked out a workaround or way of querying some chocolatey API to do this?

I'd like to ask it for say python 3.7 and get the latest 3.7.8 if that's the latest.

Ive got msys and bash at the other end, so maybe some combination of curl and scripts is doable?

stuaxo avatar Aug 19 '20 18:08 stuaxo

Here is my current workaround:

Downgrade to 0.10.13, as that allows to list all versions of a package (until https://github.com/chocolatey/choco/issues/1843 is fixed)

choco upgrade chocolatey -y --version 0.10.13 --allow-downgrade

Now you can grep the output of that for your version, in my case this is in the right order:

$ choco search -e python3 -a | grep 'python3 3.7'
python3 3.7.9 [Approved]
python3 3.7.8 [Approved]
python3 3.7.7 [Approved]
python3 3.7.6.20200110 [Approved]
python3 3.7.6 [Approved]

I want python 3.7.x, and can see all the lines I want start 'python3 3.7', so: grep for that, and take the second column, using cut, then use head to grab just the first line:

$ echo choco install python3 --version=$(choco search -e python3 -a | grep 'python3 3.7' | head | cut -d' ' -f2 | head -1) choco install python3 --version=3.7.9

(remove the 'echo' to actually install).

I'm sure there is a more powershell native way of doing this, but I don't need it in msys.

stuaxo avatar Aug 20 '20 21:08 stuaxo

When this work is done, will we be able to use build metadata with a + sign? P.g.: 1.0.0-beta+exp.sha.5114f85.

dariocc avatar Oct 01 '21 07:10 dariocc

Please note that chocolatey do support semantic version in form: A.B.C.D-tag, but does not support semantic version in form: A.B.C-tag.D

I'm not sure how crucial for end-users is to have first approach support when second one can be used instead.

Nuget core could be considered to be upgraded, but suspect it's not trivial.

tapika avatar Dec 08 '21 17:12 tapika

Speaking for myself, our organization uses the build info part of semver 2.0 extensively (aka 1.0.0+my.CI.info.12345) and that's why I'm watching this issue. It's not a blocker, but 2.0 support is pretty crucial to allowing our Chocolatey deliverables fit with the expectations of our internal users.

jaxzin avatar Dec 08 '21 17:12 jaxzin

Due to the uplift to the latest NuGet Client assemblies, this is now supported within Chocolatey CLI.

gep13 avatar Jan 24 '23 08:01 gep13

:tada: This issue has been resolved in version 2.0.0 :tada:

The release is available on:

Your GitReleaseManager bot :package::rocket:

choco-bot avatar May 31 '23 09:05 choco-bot