Skip to content

Conversation

@DilumAluthge
Copy link
Member

@DilumAluthge DilumAluthge commented Jan 9, 2020

Fixes #1605

Usage:

Command Type of warning(s)
] up This will never print a warning
] up Foo Warns if Foo can't be updated to latest
] up Foo Bar Baz Warns if any of Foo, Bar, Baz can't be updated to latest
] up -w Equivalent to ] up -w -p
] up -w -p Warns if any packages in the project can't be updated to latest
] up -w -m Warns if any packages in the manifest can't be updated to latest

Example output:

Click to expand
(@v1.5) pkg> up
   Updating registry at `~/.julia/registries/General`
   Updating `~/.julia/environments/v1.5/Project.toml`
 [no changes]
   Updating `~/.julia/environments/v1.5/Manifest.toml`
 [no changes]
(@v1.5) pkg> up BSON
   Updating registry at `~/.julia/registries/General`
   Updating `~/.julia/environments/v1.5/Project.toml`
 [no changes]
   Updating `~/.julia/environments/v1.5/Manifest.toml`
 [no changes]
┌ Warning: BSON could only be updated to 0.2.0 (the latest version is 0.2.5)
└ @ Pkg.API ~/Downloads/Pkg.jl/src/API.jl:244
(@v1.5) pkg> up BSON JLD2
   Updating registry at `~/.julia/registries/General`
   Updating `~/.julia/environments/v1.5/Project.toml`
 [no changes]
   Updating `~/.julia/environments/v1.5/Manifest.toml`
 [no changes]
┌ Warning: JLD2 could only be updated to 0.1.0 (the latest version is 0.1.11)
└ @ Pkg.API ~/Downloads/Pkg.jl/src/API.jl:244
┌ Warning: BSON could only be updated to 0.2.0 (the latest version is 0.2.5)
└ @ Pkg.API ~/Downloads/Pkg.jl/src/API.jl:244
(@v1.5) pkg> up -w
   Updating registry at `~/.julia/registries/General`
   Updating `~/.julia/environments/v1.5/Project.toml`
 [no changes]
   Updating `~/.julia/environments/v1.5/Manifest.toml`
 [no changes]
┌ Warning: JLD2 could only be updated to 0.1.0 (the latest version is 0.1.11)
└ @ Pkg.API ~/Downloads/Pkg.jl/src/API.jl:244
┌ Warning: BSON could only be updated to 0.2.0 (the latest version is 0.2.5)
└ @ Pkg.API ~/Downloads/Pkg.jl/src/API.jl:244
(@v1.5) pkg> up -w -p
   Updating registry at `~/.julia/registries/General`
   Updating `~/.julia/environments/v1.5/Project.toml`
 [no changes]
   Updating `~/.julia/environments/v1.5/Manifest.toml`
 [no changes]
┌ Warning: JLD2 could only be updated to 0.1.0 (the latest version is 0.1.11)
└ @ Pkg.API ~/Downloads/Pkg.jl/src/API.jl:244
┌ Warning: BSON could only be updated to 0.2.0 (the latest version is 0.2.5)
└ @ Pkg.API ~/Downloads/Pkg.jl/src/API.jl:244
(@v1.5) pkg> up -w -m
   Updating registry at `~/.julia/registries/General`
   Updating `~/.julia/environments/v1.5/Project.toml`
 [no changes]
   Updating `~/.julia/environments/v1.5/Manifest.toml`
 [no changes]
┌ Warning: JLD2 could only be updated to 0.1.0 (the latest version is 0.1.11)
└ @ Pkg.API ~/Downloads/Pkg.jl/src/API.jl:244
┌ Warning: BSON could only be updated to 0.2.0 (the latest version is 0.2.5)
└ @ Pkg.API ~/Downloads/Pkg.jl/src/API.jl:244

@DilumAluthge DilumAluthge changed the title Warn if ]up Foo is not able to install the latest version of Foo RFC: Warn if ]up Foo is not able to install the latest version of Foo Jan 9, 2020
@codecov
Copy link

codecov bot commented Jan 9, 2020

Codecov Report

Merging #1606 into master will decrease coverage by 0.05%.
The diff coverage is 80.43%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1606      +/-   ##
==========================================
- Coverage   86.57%   86.52%   -0.06%     
==========================================
  Files          24       24              
  Lines        5370     5416      +46     
==========================================
+ Hits         4649     4686      +37     
- Misses        721      730       +9
Impacted Files Coverage Δ
src/Pkg.jl 92.85% <ø> (ø) ⬆️
src/REPLMode/command_declarations.jl 100% <ø> (ø) ⬆️
src/API.jl 92.68% <80.43%> (-1.13%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a614255...5ae6ab3. Read the comment docs.

@StefanKarpinski
Copy link
Member

Awesome! I feel like the phrasing could be a bit clearer, but it's a bit tricky. Maybe

BSON could only be updated to v0.2.0 (the latest version is v0.2.5)

@DilumAluthge
Copy link
Member Author

DilumAluthge commented Jan 9, 2020

Awesome! I feel like the phrasing could be a bit clearer, but it's a bit tricky. Maybe

BSON could only be updated to v0.2.0 (the latest version is v0.2.5)

That looks good to me!

@DilumAluthge DilumAluthge changed the title RFC: Warn if ]up Foo is not able to install the latest version of Foo RFC: Warn if ] up Foo is not able to install the latest version of Foo Jan 9, 2020
@DilumAluthge
Copy link
Member Author

Awesome! I feel like the phrasing could be a bit clearer, but it's a bit tricky. Maybe

BSON could only be updated to v0.2.0 (the latest version is v0.2.5)

That looks good to me!

Done.

@nalimilan
Copy link
Member

How about also mentioning the command to get more information (]add PackageXYZ@1.2.3)? It's not that easy to discover.

Also, it could be useful to explicit say that this is because of version incompatibilities between installed packages. Otherwise the user could think it's because of a network problem, a bug in Julia, etc.

@timholy
Copy link
Member

timholy commented Jan 9, 2020

What about a table format?

Warning: inter-package version incompatibilities prevent installation of the latest release of the following packages:
Package    Installed    Latest    Packages holding it back
BSON       0.2.0        0.2.5     ABCD, EFGH, WXYZ
JLD2       0.1.0        0.1.11    PQRS

In "Packages holding it back" I'd envision listing only those packages present in the manifestproject that have explicit caps preventing the latest from being installed.

@fredrikekre
Copy link
Member

Maybe use [-v|--verbose] instead? If we want to print out more information in the future we can group that under the verbose flag instead of adding a new one.

@KristofferC
Copy link
Member

Just pointing it out that I have a little script that lists all packages where their last version hold back any other package:

https://gist.github.com/KristofferC/7c8048e2ee9aaa465966caeb98c1446a#file-script-jl

with the result:

https://gist.github.com/KristofferC/7c8048e2ee9aaa465966caeb98c1446a#file-packages_holding_back-md.

I am not sure it makes sense to tie displaying this information to Pkg.update. Perhaps it would be better to have a dedicated Pkg.compat_info() or something that gives a full breakdown. The script posted above could be tweaked to use the version for the packages in the project (instead of the last version) and to only show what packages in the current project that are being held back.

@fredrikekre
Copy link
Member

Yea, this doesn't seem specific to update. Why not for add, rm, dev etc?

@oxinabox
Copy link
Contributor

oxinabox commented Jan 9, 2020

The thing I am normally interested in isn't if it updated to the latest release, but if it updated to the latest version permitted by my current environment's Project.toml.

@KristofferC
Copy link
Member

Yeah, makes sense.

@jonathanBieler
Copy link

I think having a couple of specific debugging/info commands could be useful, for example I was trying to install an older version of a package but couldn't figure out what was preventing it from the error message. Being able to list all the current requirements for a package would help.

@DilumAluthge
Copy link
Member Author

Sorry, I completely forgot about this PR.

It seems like the consensus is to close this PR, and maybe in the future add a dedicated function Pkg.compat_info() based on Kristoffer's script. Is that correct?

@ericphanson
Copy link
Contributor

I think it makes sense for up Foo because I explicitly asked to update Foo and if it got blocked from doing so that seems like information that’s relevant to what I asked. I don’t think the same is true for add or rm.

I think a separate function to show compat info for the whole project would be great too.

@DilumAluthge
Copy link
Member Author

Sorry, I completely forgot about this PR.

It seems like the consensus is to close this PR, and maybe in the future add a dedicated function Pkg.compat_info() based on Kristoffer's script. Is that correct?

I'll close this in favor of adding a dedicated function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

]up PackageXYZ should give a warning if it can't deliver the newest version

9 participants