Managing dependencies in packages

How do I account for package dependencies that vary depending on the Julia version when running CI via travis?

My situation: The SpecialFunctions package in its latest version 0.10.0 requires Julia 1.3 or above. When writing a new package that should be supported for Julia 1.0 and above, does that mean I have to resort to the version of SpecialFunctions that supports Julia 1.0 (which is 0.7.2, I believe)? Or is there a way in the Project.toml and Manifest.toml files to support something like

if VERSION < v"1.3.0"
  # use Project.toml and Manifest.toml that use SpecialFunctions 0.7.2
else
  # use Project.toml and Manifest.toml that use SpecialFunctions 0.10.0
end

Thanks!

Okay, noob insight: the Manifest.toml should not be added to the repository of a Julia package. Instead, Pkg.jl creates it based on Project.toml. If the [compat] entries are correct in the Project.toml file, then no harm is done.

Perhaps it doesn’t hurt to emphasize in the documentation of Pkg.jl that any unexpected behavior can be avoided once you add Manifest.toml to your .gitignore, see this PR.

1 Like