# There should be a guide for compat-block writing

**URL:** <https://discourse.julialang.org/t/there-should-be-a-guide-for-compat-block-writing/82963>\
**Category:** General Usage\
**Tags:** package, pkg\
**Created:** [June 18, 2022, 11:16am UTC](https://discourse.julialang.org/t/there-should-be-a-guide-for-compat-block-writing/82963 "2022-06-18T11:16:17Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rratic](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rratic/32/24917_2.png) [@Rratic](https://discourse.julialang.org/u/Rratic)\
**Post date:** [June 18, 2022, 11:16am UTC](https://discourse.julialang.org/t/there-should-be-a-guide-for-compat-block-writing/82963/1 "2022-06-18T11:16:18Z")

</div>

This afternoon (time zone: `east 8`), I noticed several topics in JuliaCN, all asking about package using problems. I looked at the github repos and noticed that, although packages vary in (science) fields, they aren’t able to have an accurate `[compat]` block. And many old repo demos fail to act properly.

When I make packages myself, I don’t bother/have time to check details of dependencies either. I just use current version+a little analysis to write that block.

This problem might not seem surious currently, but combining packages will surely be difficult if this continues and package&sub-ecosystem&version amounts keep rising.

And this also contribute to discussion [Why I no longer recommend Julia](https://yuri.is/not-julia/)

So what the community probably need are:

1. a standard to **standardize necessary details** of versioning ( for example, what do same-minor **must** ensure? ) and include it in official docs
2. a package/tool/guide to check the finest way to write `[compat]` block
3. a guide for 1. and 2.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [June 18, 2022, 11:24am UTC](https://discourse.julialang.org/t/there-should-be-a-guide-for-compat-block-writing/82963/2 "2022-06-18T11:24:39Z")

</div>

[https://pkgdocs.julialang.org/dev/compatibility/](https://pkgdocs.julialang.org/dev/compatibility/)

And every package should use CompatHelper. That solves the keeping up with compat issues.

> **[GitHub - JuliaRegistries/CompatHelper.jl: Automatically update the \[compat\]...](https://github.com/JuliaRegistries/CompatHelper.jl)**
>
> Automatically update the \[compat\] entries for your Julia package's dependencies - GitHub - JuliaRegistries/CompatHelper.jl: Automatically update the \[compat\] entries for your Julia package'...

---

<div class="post-metadata">

**Author:** ![Rratic](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rratic/32/24917_2.png) [@Rratic](https://discourse.julialang.org/u/Rratic)\
**Post date:** [June 18, 2022, 11:29am UTC](https://discourse.julialang.org/t/there-should-be-a-guide-for-compat-block-writing/82963/3 "2022-06-18T11:29:14Z")

</div>

You know, that pkgdoc doesn’t **standardize necessary details** and CompatHelper requires too much resource (some packages are slow/huge, so I guess a tool/guide might be better).

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [June 18, 2022, 11:35am UTC](https://discourse.julialang.org/t/there-should-be-a-guide-for-compat-block-writing/82963/4 "2022-06-18T11:35:06Z")

</div>

> [@Rratic](#):
>
> CompatHelper requires too much resource

? It’s free and instant.

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [June 18, 2022, 11:37am UTC](https://discourse.julialang.org/t/there-should-be-a-guide-for-compat-block-writing/82963/5 "2022-06-18T11:37:32Z")

</div>

See also [GunnarFarneback/PackageCompatUI.jl](https://github.com/GunnarFarneback/PackageCompatUI.jl).

---

<div class="post-metadata">

**Author:** ![Rratic](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rratic/32/24917_2.png) [@Rratic](https://discourse.julialang.org/u/Rratic)\
**Post date:** [June 18, 2022, 11:39am UTC](https://discourse.julialang.org/t/there-should-be-a-guide-for-compat-block-writing/82963/6 "2022-06-18T11:39:38Z")

</div>

I see, I guess the second problem might be solved (I’ll test these packages later).  
But we do have 1 and 2, and the _mission_ to fix old packages.

---

<div class="post-metadata">

**Author:** ![Rratic](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rratic/32/24917_2.png) [@Rratic](https://discourse.julialang.org/u/Rratic)\
**Post date:** [June 18, 2022, 11:44am UTC](https://discourse.julialang.org/t/there-should-be-a-guide-for-compat-block-writing/82963/7 "2022-06-18T11:44:04Z")

</div>

But it requires git(hub) action (which limits without paying), instead of developing locally for smooth human use.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [June 18, 2022, 11:45am UTC](https://discourse.julialang.org/t/there-should-be-a-guide-for-compat-block-writing/82963/8 "2022-06-18T11:45:33Z")

</div>

It doesn’t limit at which you need to pay for open source repos: I’ve had it on hundreds of repos for years without paying, and it runs in about 30 seconds a few times a day. Yes it’s not local, but it’s free and instant.

---

<div class="post-metadata">

**Author:** ![Rratic](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rratic/32/24917_2.png) [@Rratic](https://discourse.julialang.org/u/Rratic)\
**Post date:** [June 18, 2022, 11:50am UTC](https://discourse.julialang.org/t/there-should-be-a-guide-for-compat-block-writing/82963/9 "2022-06-18T11:50:46Z")

</div>

> [@ChrisRackauckas](#):
>
> It doesn’t limit without paying

Limit is high, though.

I guess many developers prefer using locally and/or it’s not quoted in docs, since I rarely see action-using in groups other than `Juliaxxx`, which are usually made up of the same group of (limited) people.

---

<div class="post-metadata">

**Author:** ![aplavin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aplavin/32/222056_2.png) [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Post date:** [June 18, 2022, 12:22pm UTC](https://discourse.julialang.org/t/there-should-be-a-guide-for-compat-block-writing/82963/10 "2022-06-18T12:22:18Z")

</div>

I also hope that some day CompatHelper would support local usage. Was really surprised to see that it’s not the case still!

In the meantime, I’ve made a small package [Alexander Plavin / CompatHelperLocal.jl · GitLab](https://gitlab.com/aplavin/CompatHelperLocal.jl) (registered in General). It’s most convenient to put these lines:

```julia
import CompatHelperLocal as CHL
CHL.@check()

```

into your package tests. Then, every time the tests are run, it will check if all compats exists and are up-to-date. If not, it’ll suggest the compat section content to copy-paste into Project.toml.
