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

Ensure compatibility with latest version of all dependencies #92

Closed
rob-luke opened this issue Aug 18, 2021 · 1 comment
Closed

Ensure compatibility with latest version of all dependencies #92

rob-luke opened this issue Aug 18, 2021 · 1 comment

Comments

@rob-luke
Copy link
Owner

Handy way to view which packages are out of date (in addition to CompatHelper)...

using Pkg

cd(joinpath(DEPOT_PATH[1], "registries", "General")) do
         deps = Pkg.dependencies()
         registry = Pkg.TOML.parse(read("Registry.toml", String))
         general_pkgs = registry["packages"]
    
         constrained = Dict{String, Tuple{VersionNumber,VersionNumber}}()
         for (uuid, dep) in deps
             suuid = string(uuid)
             dep.is_direct_dep || continue
             dep.version === nothing && continue
             haskey(general_pkgs, suuid) || continue
             pkg_meta = general_pkgs[suuid]
             pkg_path = joinpath(pkg_meta["path"], "Versions.toml")
             versions = Pkg.TOML.parse(read(pkg_path, String))
             newest = maximum(VersionNumber.(keys(versions)))
             if newest > dep.version
                 constrained[dep.name] = (dep.version, newest)
             end
         end
    
         return constrained
     end
end

From https://bkamins.github.io/julialang/2020/05/11/package-version-restrictions.html

@rob-luke
Copy link
Owner Author

rob-luke commented Sep 3, 2021

Done

@rob-luke rob-luke closed this as completed Sep 3, 2021
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

1 participant