[ANN]: PkgVersionHelper.jl - check if your [deps] packages are up to date

See GitHub - xiaodaigh/PkgVersionHelper.jl

When developing packages, I often wonder Do I have the latest version of XYZ.jl? and then going to the github repo to check.

Now I can skip that step and just use

using PkgVersionHelper
upcheck()

This will look at my current environment’s Project.toml and return a

`Dict{String, Tuple{VersionNumber, VersionNumber}}`

where each key-value pair is

`PkgName => (installed_version, latest_version)`

if and only if latest_version > installed_version.

For example, this is the result of one of my runs:

julia> upcheck()
Dict{String,Tuple{VersionNumber,VersionNumber}} with 2 entries:
  "ScientificTypes" => (v"0.8.1", v"1.0.0")
  "MLJBase"         => (v"0.14.9", v"0.15.0")
12 Likes

Are you looking at [compat] specifications? At first glance it didn’t seem to be something that you’re considering

I think I see what you mean. I check for all installed packages not just those in compat. For me everything is in compat with an upper-bound. So they happened to be the same thing.

My description is not 100% accurate for the general case. Only for my case. OH well, there is always 0.1.1 when this gets registered.

What I mean is this: suppose I create a package abcd with a Project.toml that lists

[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"

[compat]
Documenter = "0.24"

Now if I run upcheck, I find

(@v1.5) pkg> activate .
 Activating environment at `~/Dropbox/JuliaPackages/abcd/Project.toml`

(abcd) pkg> st
Project abcd v0.1.0
Status `~/Dropbox/JuliaPackages/abcd/Project.toml`
  [e30172f5] Documenter v0.24.11

julia> using PkgVersionHelper

julia> upcheck()
Dict{String,Tuple{VersionNumber,VersionNumber}} with 1 entry:
  "Documenter" => (v"0.24.11", v"0.25.2")

I would have expected Documenter to be limited to 0.24 versions as 0.25 is a breaking change. Is this something that you’ll consider? Perhaps there might be an breaking = false keyword argument that one might pass to upcheck?

1 Like

I could. Also PR welcome. But finding breaking changes was my use case actually. I want to support them.

For me, I just do ] up to update to max of non-breaking anway.

In a sense therefore this is a simpler alternative to CompatHelper?

I’d say that rather than a simpler alternative to CompatHelper, it’s a tool that you can use locally for similar purposes (CompatHelper is primarily meant to interact with GitHub).

4 Likes

In my case, CompatHelper.jl helps but is not a magic bullet. For example, I got alerted to one of my MLJ dependency was outdated. Cool. So let me test out if I can support it. But then I can’t upgrade to it since it’s blocked by another dependency.

Two weeks later when I want to look at the problem again. I would have forgotten about the CompatHelper PR. So a tool like this would be invaluable to help me discover what I need to update.

I noticed that currently this warns about a package not being registered even for stdlib entries. I wonder if there’s a way to confirm if a package is in stdlib and ignore version checking for these?

If you are wild enough to rely on Pkg internals you can do

julia> Pkg.Types.is_stdlib(UUID("9a3f8284-a2c9-5f02-9a11-845980a1fd5c"))
true
1 Like

There aren’t too many stdlib packages. I’d suggest probably just make that list by hand and add them as exclusions.

version 0.1.1. PR welcome.

exactly.

fixed in latest update. Will push 0.1.1 once 0.1 is registered

They change between different versions of Julia, I wouldn’t do that

1 Like