Functions

Exported functions

PkgHelpers.freezeFunction
freeze(pkg; julia=juliaversion(), relaxed = false, copy_manifest=false, keep=true)

Freezes the current package versions by adding them to the Project.toml file.

Arguments

  • pkg: the module Pkg
  • julia: version string for Julia compatibility, e.g. "1" or "~1.8, ~1.9, ~1.10"
  • relaxed: if set to true, the minor version number is omitted from the generated compat entries. This means, non-breaking minor updates are allowed.
  • copy_manifest: if true, create a copy of the current Manifest.toml file using a naming scheme like "Manifest.toml-1.10-windows"
  • keep: if true (deftault) any existing compat entries are kept as is (maybe reordered)

For strict compatibility only add the Julia versions you tested your project with.

Examples

using Pkg, PkgHelpers
freeze(Pkg, copy_manifest=true)
freeze(Pkg; julia="~1.9, ~1.10", copy_manifest=true)
source
PkgHelpers.lower_boundFunction
lower_bound(pkg; julia=nothing, relaxed = false, copy_manifest=false, keep=true)

Adds the current package versions as lower bound to the compat section of the Project.toml file.

Arguments

  • pkg: the module Pkg
  • julia: version string for Julia compatibility, e.g. "1" or "1.8"
  • relaxed: if set to true, the minor version number is omitted from the generated compat entries.
  • copy_manifest: if true, create a copy of the current Manifest.toml file using a naming scheme like "Manifest.toml-1.10-windows"
  • keep: if true (deftault) any existing compat entries are kept as is (maybe reordered)

Examples

using Pkg
lower_bound(Pkg)
source
PkgHelpers.copy_manifestFunction
copy_manifest()

Create a copy of the current manifest, using a naming scheme like "Manifest.toml-1.10-windows" which includes the major Julia version number and the name of the operating system to be added and committed to git as backup.

source

Internal helper functions

PkgHelpers.project_compatFunction
project_compat(pkg,relaxed,lowerbound; prn=false, status="")

Create a dictionary of package dependencies and their current versions.

Returns the full file name of the Project.toml file and the dictionary compat that can be added to the Project.toml file to freeze the package versions.

Returns the tuple (project_file, compat).

source
PkgHelpers.juliaversionFunction
juliaversion(lowerbound=false)

Returns the version number in the form "~1.10" by default and in the form "1.10" when called with the parameter true.

source
PkgHelpers.toml_orderFunction
toml_order(key)

Specify the correct order for the different items of the TOML files. The keys name, uuid, autors and version occur in that order at the top of the TOML as keys pointing to string values. They are followed by the deps, compat, extras and targets keys that point to dictionaries a level lower.

source