Project.toml -- How to specify package dependencies

Hello all,

I’m making progress on my first Julia package. Here’s what I have in my Project.toml file:

[compat]
julia = "1.0"

Does anyone know how to specify that a package should work on either Julia 0.7 or Julia 1.0 ? I tried a few random guesses but they were all wrong.

1 Like

Similar to other package managers, the Julia package manager respects semantic versioning (semver). As an example, a version specifier is given as e.g. 1.2.3 is therefore assumed to be compatible with the versions [1.2.3 - 2.0.0) where ) is a non-inclusive upper bound. More specifically, a version specifier is either given as a caret specifier , e.g. ^1.2.3 or a tilde specifier ~1.2.3 . Caret specifiers are the default and hence 1.2.3 == ^1.2.3 . The difference between a caret and tilde is described in the next section. The intersection of multiple version specifiers can be formed by comma separating indiviual version specifiers.

https://docs.julialang.org/en/v1/stdlib/Pkg/index.html#Version-specifier-format-1

1 Like

Thanks!