Choco: Support Semantic Versioning 2.0.0 (semver)

Created on 6 Jul 2018  路  12Comments  路  Source: chocolatey/choco

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

0 - Backlog CoreTeam Enhancement

Most helpful comment

Is there any timeline for the this will be included?

All 12 comments

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.)

@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.

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, 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 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, what do you mean? That we can already test it on choco itself? Is there anything I can do to help?

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

Is there any timeline for the this will be included?

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.

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?

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.

Was this page helpful?
0 / 5 - 0 ratings