Paket update behavior on pinned version
Hello!
I am investigating a move from NuGet to Paket for our package restore process.
I was able to use convert-from-nuget for starting to play around. It generated a paket.dependencies with pinned versions:
nuget TaskScheduler 1.8.1
I'm not sure I understand 100% what pinned means, but we certainly do want to only use this specific version in our codebase.
I wanted to see how easy it is to update a package version for the whole codebase, this is where our pain is currently with the Package Manager.
When I execute this command:
$ .paket/paket.exe update nuget TaskScheduler version 2.5.5
Paket version 2.36.0.0
Updating TaskScheduler to version 2.5.5 in C:\SVN\Chinook2\paket.dependencies group Main
Resolving packages for group Main:
- TaskScheduler is pinned to 2.5.5
I get a unmodified paket.dependencies:
nuget TaskScheduler 1.8.1
and an updated paket.lock:
TaskScheduler (2.5.5)
Running paket install does not download TaskScheduler 2.5.5
So I reverted those changes and simply edited the paket.dependencies to have:
nuget TaskScheduler 2.5.5
Then paket install downloaded as expected the new version and I had the behavior I expected.
From what I understood, paket.dependencies shall pilot the version constraints for the codebase, and paket.lock shall reflect a resolution of those constraints. Am I getting something wrong?
This looks like a bug to me. Paket update nuget should either not allow that or up the dependencies file. I'm looking into this.
That said:
Usually you want to remove the version numbers in paket.dependencies after convert-from-nuget and only have versions in paket.lock. The convert function is very conservative and tries to keep nuget behavior as good as possible.
But after convert you should start to "clean up" the dependencies file and remove all restrictions that you don't need when updating packages. The restore process is always looking into the lock file. So whatever version no. is specified there will be used. On Dec 10, 2015 10:56 AM, "Miguel Vazquez" [email protected] wrote:
Hello! I am investigating a move from NuGet to Paket for our package restore process. I was able to use convert-from-nuget for starting to play around. It generated a paket.dependencies with pinned versions: nuget TaskScheduler 1.8.1 I'm not sure I understand 100% what pinned means, but we certainly do want to only use this specific version in our codebase.
I wanted to see how easy it is to update a package version for the whole codebase, this is where our pain is currently with the Package Manager.
When I execute this command: $ .paket/paket.exe update nuget TaskScheduler version 2.5.5 Paket version 2.36.0.0 Updating TaskScheduler to version 2.5.5 in C:\SVN\Chinook2\paket.dependencies group Main Resolving packages for group Main:
- TaskScheduler is pinned to 2.5.5
I get a unmodified paket.dependencies: nuget TaskScheduler 1.8.1 and an updated paket.lock: TaskScheduler (2.5.5)
From what I understood, paket.dependencies shall pilot the version constraints for the codebase, and paket.lock shall reflect a resolution of those constraints. Am I getting something wrong?
— Reply to this email directly or view it on GitHub https://github.com/fsprojects/Paket/issues/1301.
Thanks Steffen for you feedback. So what is the recommended process to upgrade a specific package to a specific version for the whole codebase?
The "standard" workflow is: remove version from dependencies file and run the command as above (or only "paket update" is you want to update everything). This will change the version number in paket.lock and all projects get updated version. Don't forget to commit the lock file.
As a rule of thumb: The dependencies file describes all your top level dependencies and additional version requirements for these. So one possible line could be: nuget NUnit ~> 2
This will ensure that you get the latest nunit version that is in v2 channel (and don't get breaking changes from v3)
But usually most lines are just: nuget Newtonsoft.Json
The real improve info is in the paket.lock file where all dependencies (incl transitive) are pinned to concrete versions. On Dec 10, 2015 12:02 PM, "Miguel Vazquez" [email protected] wrote:
Thanks Steffen for you feedback. So what is the recommended process to upgrade a specific package to a specific version for the whole codebase?
— Reply to this email directly or view it on GitHub https://github.com/fsprojects/Paket/issues/1301#issuecomment-163579498.