Respecting Compat Bounds from Project.toml in Julia Package on GitHub CI

Hello,

I’m the maintainer of a Julia package, and I’ve specified version restrictions for dependencies in the [compat] section of my Project.toml file. However, when running CI workflows on GitHub, it seems to be using the latest versions of these dependencies, which is causing some issues.

Is there a way to ensure that the CI respects the version restrictions specified in the Project.toml file? Has anyone faced a similar issue and found a solution?

Any advice or resources would be highly appreciated.

Thanks in advance!

Best,
Diego

It would be easier to diagnose if you provide a pointer to the Project.toml file in question and what version you are seeing in CI.

1 Like

My guess is you have something like Foo = "1.2.3" in your compat, and you’re expecting to get v1.2.3 when actually this compat bound allows any version from v1.2.3 less than v2.0.0 as per semver.

If you want tighter bounds (which are generally not recommended) then you need to use ~ or = as per the docs: 6. Compatibility · Pkg.jl

3 Likes

If this is indeed the problem (which would be my guess too), the PackageCompatUI package is a convenient way to see what the compat bounds really mean and adjust them to give the compat you want to have.

5 Likes

Hello again,

Specifically, I am encountering an issue related to the NamedArrays package in MIToS.jl.

In MIToS.jl, I have defined compatibility bounds for NamedArrays to avoid versions 0.9.7 and 0.9.8 while allowing any other version within the 0.9.x range. However, during the GitHub CI workflow, I discovered that the problem lies in testing the project with Julia 1.0, which results in the installation of version 0.9.8 of NamedArrays.

Thank you to those who provided suggestions and insights. I will test the proposed solutions to address this issue and see if they resolve the problem. As you can see in the last commits of the package, I have tested many options based on the compat section of the docs without success.

For reference, the relevant entry in the Project.toml file can be found here.

Once again, thanks!

Best regards,

Thanks ! I can see that I have misunderstood the way in which semver works.

Thanks, @GunnarFarneback ! Your PackageCompatUI package is awesome; it has solved my problem :slight_smile: