[ANN] PkgHelpers 0.2.2 released

PkgHelpers provides the functions freeze() and lower_bound() to update your Project.toml file and freeze or lower_bound your direct dependencies.

New:

  • the new entries in Project.toml are sorted
  • the parameter copy_manifest allows to
    create a copy of your manifest file under
    a distinct name wich documents also the
    versions of your indirect dependencies
  • PkgHelpers works now with Julia 1.4 to 1.11

Usage:

  1. add PkgHelpers to your global environment
  2. in your local project type
using Pkg, PkgHelpers
freeze(Pkg, copy_manifest=true)
freeze(Pkg; julia="~1.9, ~1.10", copy_manifest=true)

The following options are available:

function compat entry range specifier
freeze(Pkg) “=1.2.3” [1.2.3, 1.2.3] equality
freeze(Pkg; relax=true) “~1.2.3” [1.2.3, 1.3.0) tilde
lower_bound(Pkg) “1.2.3” [1.2.3, 2.0.0) caret
lower_bound(Pkg; relax=true) “1.2” [1.2.0, 2.0.0) caret

In contrast to the approach of committing the Manifest directly to git, this approach allows to work from multiple computers on one project using different versions of Julia on different operating systems without getting any merge conflicts.

3 Likes

My understanding is that PkgHelpers is an alternative to sending the manifest and then calling Pkg.instantiate, right? What are the problems you encountered with the existing solution of instantiate?

1 Like

Well, if you have different versions of Julia you cannot use the same Manifest.toml file… And if you commit it to git you get merge conflicts…

A frozen Package.toml file can work with many versions of Julia and many operating systems. If there is a merge conflict you can easily resolve it manually, no fun to solve a merge conflict of a Manifest.toml file.

In addition, a Package.toml file where the versions of all packages are specified is a nice documentation of your dependencies, new users can google the packages you used. The indirect dependencies are in general less interesting.

Finally, if you add a new package to your project the current Manifest.toml is ignored and overwritten, but the current Project.toml file is respected.

3 Likes