-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Partial package updates #17132
Partial package updates #17132
Conversation
If packages
could this update |
@toivoh: no, dependency resolution is done the same way as always, just with additional constraints on packages which shouldn't be updated. If it happens, it's a bug. |
@@ -203,8 +203,12 @@ pin(pkg::AbstractString, ver::VersionNumber) = cd(Entry.pin,pkg,ver) | |||
Update the metadata repo – kept in `Pkg.dir("METADATA")` – then update any fixed packages | |||
that can safely be pulled from their origin; then call `Pkg.resolve()` to determine a new | |||
optimal set of packages versions. | |||
|
|||
update(pkgs...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these should be separate docstrings for the docsystem to handle them properly - the new signature should be added to the rst version of the docs (kinda messy at the moment) so make docs
populates the rest of it
9d8dc0d
to
719822c
Compare
Added tests (kind of messy, but the best I could come up with), docs, item in NEWS, and rebased. |
@@ -66,6 +66,73 @@ function dependencies(avail::Dict, fix::Dict = Dict{String,Fixed}("julia"=>Fixed | |||
avail, conflicts | |||
end | |||
|
|||
function partial_update_mask(instd::Dict{String,Tuple{VersionNumber,Bool}}, avail::Dict{String,Dict{VersionNumber,Available}}, upkgs::Set{String}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the Bool
in this Tuple?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the fixed
tag as returned by Read.installed
, see here.
I tend to spell out the type signatures in full in these functions (rather than just writing instd::Dict
) mostly for "documentation" purposes.
47f9973
to
b096ef8
Compare
I have addressed all the comments (as always, thanks @tkelman!) and rebased. |
# the latest version | ||
blocking_parents = Set{String}() | ||
for (p1,d1) in deps | ||
p1 in upkgs && continue # package `p1` is among the ones to be updated, skip the check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️ the comments
This is great, glad you had a more productive JuliaCon hacking session than I did. Kind of sneaking in a feature, but I say we merge it. A side-effect of having this feature is that too-loose version bounds in packages on their dependencies will now be more visible. We may have to work out an automated cross-package multi-version testing system to identify that kind of issue. |
I'm also in favor of merging this. People will be a lot less unhappy with the current package manager if they don't have to wait until Pkg3 for this nice functionality :) |
This introduces the possibility to do
Pkg.update(pkgs...)
and only update a subset of the packages.The result is that only the packages explicitly provided and their dependencies will be updated, everything else is kept fixed.
For example:
Also, the packages explicitly provided will never get downgraded (which is a rare occurrence, but in principle may happen with a full
Pkg.update()
).In case the update fails to install the latest version of the packages explicitly provided, an info message is emitted, and some analysis is attempted to suggest possible causes (a full analysis is basically out of the question, and unlikely to be of any practical relevance IMO). For example, in a case in which I had artificially capped the version of
Colors.jl
:Still missing:
tests, perhaps extra docs (? Someone please advise me on this, I only updated the docstring and it works in the repl, should I do something else?), probably some note in NEWS.We may also want to add a keyword argument to truly restrict the update to the packages given as arguments, not their dependencies (e.g.
dependencies=false
? Suggestions welcome). This however would require some additional work, especially to perform the analysis afterwards. Maybe it can be done as a second PR.I tried to test this functionality in a variety of cases (registered packages, unregistered ones, dirty ones, checked out, etc.) but it would be best if other people could put this to test as well.
[edit by tkelman: closes #13487]