Ignore Manifest.toml when testing a package

Hi,

I am testing a local package with different version of Julia.
And I always get the message:
“The active manifest file has dependencies that were resolved with a different julia version. Unexpected behaviour may occur.”

1/ How can I ignore the manifest when running test?
2/ How can I prevent this file from being create?

This manifest is created everytime I run a test.
Thank you

1 Like

Manifest.toml contains the exact versions of the packages used for running the code.
These may differ between Julia versions due to compatibility settings of the packages.

Your questions are a bit misguided in the sense that Manifest.toml is absolutely central to how Pkg.jl works. However what you should do is recreate Manifest.toml if you change Julia version. Either by deleting it (then Pkg.jl recreates it automatically) or be activating the environment and calling Pkg.resolve() which recreates it.

Alternatively if your package is a git repository (which it should be) you could just clone the repository to a different location for testing. Note that package repositories should not contain Manifest.toml (only Project.toml).

2 Likes

Instead of the command

julia-1.10 --project="." -e 'using Pkg; Pkg.test()'

prepare the Project.toml and Manifest.toml files using the commands

julia-1.9 --project=env-1.9 -e 'using Pkg; Pkg.develop(path=".")'
julia-1.10 --project=env-1.10 -e 'using Pkg; Pkg.develop(path=".")'

Then you can use for each tests

julia-1.9 --project=env-1.9 -e 'using Pkg; Pkg.test("MyPackage")'
julia-1.10 --project=env-1.10 -e 'using Pkg; Pkg.test("MyPackage")'

The directories env-* have to be added to .gitignore. You can also prepare the environments from an arbitrary directory and adjust Pkg.develop(path="path_to/MyPackage").

Julia 1.11 will have the possibility to have different manifests for different Julia versions: julia/NEWS.md at v1.11.0-alpha2 · JuliaLang/julia · GitHub .

1 Like