Skip to content
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

Show package version and whether it's the latest after ] add command #2682

Closed
Wikunia opened this issue Aug 4, 2021 · 7 comments
Closed

Comments

@Wikunia
Copy link

Wikunia commented Aug 4, 2021

Currently the output of add OrdinaryDiffEq looks roughly like:

(tmp.4uUytIOkzt) pkg> add OrdinaryDiffEq
    Updating registry at `~/.julia/registries/General`
   Resolving package versions...
   Installed PreallocationTools ─ v0.1.0
   Installed SLEEFPirates ─────── v0.6.25
   Installed Tables ───────────── v1.5.0
   Installed SparseDiffTools ──── v1.16.1
   Installed DiffEqBase ───────── v6.71.0
   Installed Setfield ─────────── v0.7.1
   Installed StaticArrays ─────── v1.2.10
   Installed OrdinaryDiffEq ───── v5.60.2
   Installed NLSolversBase ────── v7.8.1
   Installed Polyester ────────── v0.3.8
   Installed VectorizationBase ── v0.20.29
   Installed LoopVectorization ── v0.12.61

and then shows the important info:

[1dea7af3] + OrdinaryDiffEq v5.60.2

for a few milliseconds
and creating tenth of lines about which versions of packages are added to the Manifest file.

at the very end it shows:

Precompiling project...
  26 dependencies successfully precompiled in 99 seconds (60 already precompiled)

I think the most important information the user wants is missing here:

  • Which version is installed (this is actually printed but isn't prominent in the list of stuff that most people probably don't understand)
  • Is the installed version the newest version available?

The second question is important when one has multiple packages in the environment and they aren't compatible with each other. Currently this can result in installing an ancient version of a package without notifying the user. That user will probably checked the latest version of the docs though and is frustrated that something doesn't work and either moves away from the package or creates an issue where they still might not realize that it is an old version.

I suggest therefore to end the ] add command with something like:

Package v0.5 was added as the newest version v0.7 isn't compatible
or The latest version of Package (v0.7) was successfully installed

Maybe the upper one in orange and the lower one in green.

I'm happy to work on a PR for this. If you have any pointers of where I should start I would be very grateful.

@IanButterworth
Copy link
Member

There's a lot of support for this, and an issue already #1655 but perhaps part of this issue is just raising the prominence of which package was installed in the output? Perhaps that's unique, so worth keeping this issue open for?

@Wikunia
Copy link
Author

Wikunia commented Aug 4, 2021

I feel it's distinct as that one is written for up and I think knowing in either case which version is installed even if it is the newest is useful

@KristofferC
Copy link
Member

KristofferC commented Aug 5, 2021

I think it is ok if this is not shown in the output for add but only when you do status. I'm updating #2284 now and you can see how you like that when it's done.

@Wikunia
Copy link
Author

Wikunia commented Aug 5, 2021

I don't think that this is enough. New users want to know whether the docs they check are matching the version they installed. They can double check that with your PR but they can't just assume it.

I don't assume that the PR will reduce the number of issues created on packages where something didn't fit the documentation simply because an older version was installed unknowingly.

@robsmith11
Copy link

robsmith11 commented Oct 2, 2021

I really think add should ask the user to confirm whether he really wants to install a given version if it's not the latest possible version.

So often I assume it installed the latest version only to realize later that it ended up installing an old version because of some random conflict.

@KristofferC
Copy link
Member

KristofferC commented Oct 4, 2021

If you have requirements for what version you need, the way to most easily handle that is to add that to the [compat] section of your Project.toml file. So if you need version 2.3.1 or later of package Foo you add:

[compat]
Foo = "2.3.1"

to the Project file.

@KristofferC
Copy link
Member

Done in #2906

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

No branches or pull requests

4 participants