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

**URL:** <https://discourse.julialang.org/t/what-to-put-in-compat-section-of-project-toml/68800>\
**Category:** Package Management\
**Created:** [September 27, 2021, 8:04am UTC](https://discourse.julialang.org/t/what-to-put-in-compat-section-of-project-toml/68800 "2021-09-27T08:04:00Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![colintbowers](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/colintbowers/32/8033_2.png) [@colintbowers](https://discourse.julialang.org/u/colintbowers)\
**Post date:** [September 27, 2021, 8:04am UTC](https://discourse.julialang.org/t/what-to-put-in-compat-section-of-project-toml/68800/1 "2021-09-27T08:04:00Z")

</div>

Hi all,

I’m just trying to make a few changes to a registered package of mine [DependentBootstrap](https://github.com/colintbowers/DependentBootstrap.jl). 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 🙂 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](https://github.com/colintbowers/DependentBootstrap.jl/commit/e2df708ceca732ab1d37f6c2b86765953468647a) then [Automerge fails](https://github.com/JuliaRegistries/General/pull/45407/checks?check_run_id=3717530498) with the following:

```julia
┌ 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:

```julia
[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

---

<div class="post-metadata">

**Author:** ![mauro3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mauro3/32/292_2.png) [@mauro3](https://discourse.julialang.org/u/mauro3)\
**Post date:** [September 27, 2021, 8:17am UTC](https://discourse.julialang.org/t/what-to-put-in-compat-section-of-project-toml/68800/2 "2021-09-27T08:17:52Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![colintbowers](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/colintbowers/32/8033_2.png) [@colintbowers](https://discourse.julialang.org/u/colintbowers)\
**Post date:** [September 27, 2021, 10:45am UTC](https://discourse.julialang.org/t/what-to-put-in-compat-section-of-project-toml/68800/3 "2021-09-27T10:45:59Z")

</div>

Thanks for responding

> [@mauro3](#):
>
> Copy those versions over.

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

> [@colintbowers](#):
>
> `DataFrames = "0.20"`

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).

---

<div class="post-metadata">

**Author:** ![mauro3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mauro3/32/292_2.png) [@mauro3](https://discourse.julialang.org/u/mauro3)\
**Post date:** [September 27, 2021, 11:02am UTC](https://discourse.julialang.org/t/what-to-put-in-compat-section-of-project-toml/68800/4 "2021-09-27T11:02:49Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![colintbowers](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/colintbowers/32/8033_2.png) [@colintbowers](https://discourse.julialang.org/u/colintbowers)\
**Post date:** [September 27, 2021, 11:33am UTC](https://discourse.julialang.org/t/what-to-put-in-compat-section-of-project-toml/68800/5 "2021-09-27T11:33:39Z")

</div>

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

```julia
[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.

---

<div class="post-metadata">

**Author:** ![ericphanson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ericphanson/32/215186_2.png) [@ericphanson](https://discourse.julialang.org/u/ericphanson)\
**Post date:** [September 27, 2021, 11:36am UTC](https://discourse.julialang.org/t/what-to-put-in-compat-section-of-project-toml/68800/6 "2021-09-27T11:36:47Z")

</div>

> [@colintbowers](#):
>
> ```julia
> ┌ Debug: Found a new (non-stdlib non-JLL) dependency: StatsBase
> └ @ RegistryCI.AutoMerge ~/.julia/packages/RegistryCI/Nj1Mv/src/AutoMerge/guidelines.jl:92
> 
> ```

Did you see the comment [New version: DependentBootstrap v1.1.3 by JuliaRegistrator · Pull Request #45407 · JuliaRegistries/General · GitHub](https://github.com/JuliaRegistries/General/pull/45407#issuecomment-925745171) 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).

---

<div class="post-metadata">

**Author:** ![zdenek\_hurak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zdenek_hurak/32/53118_2.png) [@zdenek\_hurak](https://discourse.julialang.org/u/zdenek_hurak)\
**Post date:** [September 27, 2021, 12:20pm UTC](https://discourse.julialang.org/t/what-to-put-in-compat-section-of-project-toml/68800/7 "2021-09-27T12:20:35Z")

</div>

> [@colintbowers](#):
>
> my `DataFrames = "0.2"` implies `[0.2, 1.0)`

Does it? See [Behavior of versions with leading zeros (0.0.x and 0.x.y)](https://pkgdocs.julialang.org/v1/compatibility/#compat-pre-1.0)

---

<div class="post-metadata">

**Author:** ![colintbowers](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/colintbowers/32/8033_2.png) [@colintbowers](https://discourse.julialang.org/u/colintbowers)\
**Post date:** [September 27, 2021, 1:12pm UTC](https://discourse.julialang.org/t/what-to-put-in-compat-section-of-project-toml/68800/8 "2021-09-27T13:12:04Z")

</div>

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 🙂

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.

---

<div class="post-metadata">

**Author:** ![colintbowers](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/colintbowers/32/8033_2.png) [@colintbowers](https://discourse.julialang.org/u/colintbowers)\
**Post date:** [September 27, 2021, 1:13pm UTC](https://discourse.julialang.org/t/what-to-put-in-compat-section-of-project-toml/68800/9 "2021-09-27T13:13:40Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)\
**Post date:** [September 27, 2021, 2:25pm UTC](https://discourse.julialang.org/t/what-to-put-in-compat-section-of-project-toml/68800/10 "2021-09-27T14:25:54Z")

</div>

> [@colintbowers](#):
>
> I’ve been reading on this for hours now and am not going anywhere. Any help you all could offer would be most appreciated.

I believe what you really want is [PackageCompatUI](https://discourse.julialang.org/t/ann-packagecompatui/58118)

---

<div class="post-metadata">

**Author:** ![colintbowers](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/colintbowers/32/8033_2.png) [@colintbowers](https://discourse.julialang.org/u/colintbowers)\
**Post date:** [September 28, 2021, 2:25am UTC](https://discourse.julialang.org/t/what-to-put-in-compat-section-of-project-toml/68800/11 "2021-09-28T02:25:21Z")

</div>

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