What to put in [compat] section of Project.toml

Hi all,

I’m just trying to make a few changes to a registered package of mine DependentBootstrap. Unfortunately, every time I do this (once a year or so) I seem to end up here because something goes wrong. Note, I’m blaming myself for this, not anyone else :slight_smile: I tend to only need to think about github or the inner workings of the julia package ecosystem once every few years, so I’m not very good at it.

Anyway, my current problem is that when I run @JuliaRegistrator register on my latest commit then Automerge fails with the following:

┌ Debug: Found a new (non-stdlib non-JLL) dependency: StatsBase
└ @ RegistryCI.AutoMerge ~/.julia/packages/RegistryCI/Nj1Mv/src/AutoMerge/guidelines.jl:92
┌ Debug: Found a new (non-stdlib non-JLL) dependency: Distributions
└ @ RegistryCI.AutoMerge ~/.julia/packages/RegistryCI/Nj1Mv/src/AutoMerge/guidelines.jl:92
┌ Debug: Found a new (non-stdlib non-JLL) dependency: DataFrames
└ @ RegistryCI.AutoMerge ~/.julia/packages/RegistryCI/Nj1Mv/src/AutoMerge/guidelines.jl:92
┌ Debug: Found a new (non-stdlib non-JLL) dependency: TimeSeries
└ @ RegistryCI.AutoMerge ~/.julia/packages/RegistryCI/Nj1Mv/src/AutoMerge/guidelines.jl:92
┌ Debug: Dependency "julia" has a compat entry with an upper bound
└ @ RegistryCI.AutoMerge ~/.julia/packages/RegistryCI/Nj1Mv/src/AutoMerge/guidelines.jl:118
┌ Error: Dependency "StatsBase" does not have a compat entry that has an upper bound
└ @ RegistryCI.AutoMerge ~/.julia/packages/RegistryCI/Nj1Mv/src/AutoMerge/guidelines.jl:134
┌ Error: Dependency "Distributions" does not have a compat entry that has an upper bound
└ @ RegistryCI.AutoMerge ~/.julia/packages/RegistryCI/Nj1Mv/src/AutoMerge/guidelines.jl:134
┌ Error: Dependency "DataFrames" does not have a compat entry that has an upper bound
└ @ RegistryCI.AutoMerge ~/.julia/packages/RegistryCI/Nj1Mv/src/AutoMerge/guidelines.jl:134
┌ Error: Dependency "TimeSeries" does not have a compat entry that has an upper bound
└ @ RegistryCI.AutoMerge ~/.julia/packages/RegistryCI/Nj1Mv/src/AutoMerge/guidelines.jl:134

Last I checked I didn’t need to include anything in the Project.toml file about the dependencies of my package. Indeed the current version of the docs states under “Compatability”:

If the compatibility for a dependency is not given, the project is assumed to be compatible with all versions of that dependency.

so I’m not really sure why I’m getting this error at all. Nonetheless, I tried adding various things under the [compat] heading in the Project.toml file of my package and nothing I do seems to work. For example, I tried adding lines like:

[compat]
Julia = "1"
DataFrames = "0.20"
Distributions = "0.22"
StatsBase = "0.33"
TimeSeries = "0.17"

but then I get errors about narrowing the scope of packages unnecessarily.

I’ve been reading on this for hours now and am not going anywhere. Any help you all could offer would be most appreciated.

Cheers,

Colin

In your local copy of the repo, first update the packages. Then do a status which will tell you at what version the packages are. Copy those versions over. You can try to be more fancy by allowing more version, but that is more work, at least if you make sure that those versions do indeed also work.

2 Likes

Thanks for responding

I’m not sure what you mean by this. Do you mean I need to include lines like this:

in my Project.toml?

BTW in terms of the actual versions of these packages I need, I can confidently say that my package will work with any version of any of these packages from the last 2-3 years (basically since julia v1.0).

You need to include the version bounds if you want auto-merging to happen. If you don’t, someone will need to merge your new version by hand (and I guess you need to explain to them why you leave them away ;-).

And, yes, like this. Of course you should check that the version you use now works with the dependent packages at this point, ideally, by running your comprehensive test-suite…

I wouldn’t bother to find out what older versions also work, as that is very tedious. If someone needs something specific they can open an issue

2 Likes

Ah, understood thanks. And sorry one last quick question just to be sure I understand how it all works correctly, if I put say:

[compat]
julia = "1"
DataFrames = "1"
Distributions = "0.25"
# and so on for other packages with appropriate lower-bound

then this should work, assuming I put the appropriate lower-bound for the version number in?

I did actually try this, but I didn’t try it using status like you suggested, so I think the problems I encountered were caused by my use of DataFrames = "0.20", when I actually needed DataFrames = "1", since my DataFrames = "0.2" implies [0.2, 1.0)

Thanks again for your help.

Did you see the comment New version: DependentBootstrap v1.1.3 by JuliaRegistrator · Pull Request #45407 · JuliaRegistries/General · GitHub btw? I ask because usually only AutoMerge maintainers (rarely) need the raw logs, and that comment is supposed to be the “user-facing” bit that ideally explains or links to everything you need to know (but sometimes falls short in that).

2 Likes

Does it? See Behavior of versions with leading zeros (0.0.x and 0.x.y)

1 Like

Yes I started with the comment and then proceeded to the logs. Just out of habit really - I was trying to glean every bit of info I could. The comment in that one was very clear :slight_smile:

I did have another attempt that failed where I found the comment less clear, but I didn’t take note if it at the time which I should have. Something about the version range becoming too narrow.

1 Like

Haha you’re right and even worse it is literally right there in the example provided in the docs. To be fair to me, I did mention at the start of this post that I’m not very good at this stuff.

1 Like

I believe what you really want is PackageCompatUI

2 Likes

That’s very nice. I wasn’t aware of that tool. Very helpful thank you.