Ok, so I recently discovered – much to my surprise – that ] update Foo in fact updates all of the packages in my project. To update a single package you have to instead do ] up Foo. This is super, super confusing. I’ve been doing ] update Foo this whole time incorrectly.
Can we fix this somehow? Either a single, combined command for updating packages or at the very least an error if you give unexpected arguments to these commands.
Oh woah that’s nuts… I’m confused in my own confusion. So if up and update are synonymous then eg both ] update DataFrams and ] up DataFrames actually update all the packages, the DataFrames bit is completely ignored.
How do I update just a single package?
I’d like to present my own misunderstanding of my own confusion as further evidence that this interface is confusing
In any case, assuming this hasn’t changed, I think the solution for now is 1) either pin things you for sure don’t want to update or 2) version control your Manifest.toml so you can always roll back if something broke.
Indeed there have been some changes. AFAIK the tiered resolver approach has been implemented, and you can even specify a --preserve option for the tier. Updating a package however should always fix unrelated dependencies in your project.
From a purely practical standpoint how do I simply update a single update a single package and its dependencies? All I need is something analogous to what I can do in npm, yarn, cargo, etc.
Pkg should already be doing just that. ]up Foo will only update Foo and its dependencies, and will even leave shared dependencies with other added packages in the same project untouched. If your entire project is being updated, this is likely a bug unless you’re using Julia pre-1.0. Could you produce an MWE?
Just for reference, this is actually mentioned explicitly in the Pkg docs:
Simply calling up will try to update all the dependencies of the project to the latest compatible version. Sometimes this is not what you want. You can specify a subset of the dependencies to upgrade by giving them as arguments to up
These are good solutions, also sometimes doing add DataFrames@v1.<whatever> gives a different result than up, and may give a more informative error if there are things that are blocking.
Unless someone can produce toml files that reproduces this it will be difficult to tell what is going on. I can at least verify that basic examples work as expected:
$ pkg st
Status `/tmp/tmp.YQdQZVnahc/Project.toml`
[a93c6f00] DataFrames v0.21.6
[7876af07] Example v0.5.1
$ pkg up DataFrames
Updating `/tmp/tmp.YQdQZVnahc/Project.toml`
[a93c6f00] ↑ DataFrames v0.21.6 ⇒ v0.21.7
Updating `/tmp/tmp.YQdQZVnahc/Manifest.toml`
[a93c6f00] ↑ DataFrames v0.21.6 ⇒ v0.21.7
$ pkg up
Updating `/tmp/tmp.YQdQZVnahc/Project.toml`
[7876af07] ↑ Example v0.5.1 ⇒ v0.5.3
Updating `/tmp/tmp.YQdQZVnahc/Manifest.toml`
[7876af07] ↑ Example v0.5.1 ⇒ v0.5.3
So I asked it to update DifferentialEquations.jl, and it doesn’t say anything about DifferentialEquations.jl, but it updated all kinds of other stuff. What’s up with that?