Is there a function to check if every package in my [deps] has a [compat] entry in Project.toml?

Sometimes, before I publish a new version of the package I accidentally forget that I’ve added a package to the dependencies and forgot to add [compat] entries in Project.toml.

I think I should add a git hook to remind me, but I wanted to check if there’s a simple function that I can use to check for missing [compat] vs [deps].

2 Likes

I’m not familiar with its API (so I can’t point you directly to the function you want), but that’s what RegistryCI.jl does.

1 Like

I think that Aqua.jl offers this as one of its features.

3 Likes

I guess you rather want something that can be automated but for interactive use, PackageCompatUI will clearly show if you’re missing some compat and let you quickly correct it.

2 Likes

If your package is already pushed to GitHub and you have setup CompatHelper.jl with workflow_dispatch:, then you can also trigger a CompatHelper run in the GitHub Actions tab to detect missing compat entries.

2 Likes

cool

PkgTemplates.jl sets the GitHub Action for CompatHelper.jl even up as default.

Checking [compat] entries without depending on anything else is literally the function of the CompatHelperLocal.jl package [disclaimer: I’m the author].
Doesn’t require uploading your package to github or registering it anywhere, just run

import CompatHelperLocal as CHL
CHL.@check()

and get the updated [compat] content if it’s incomplete or outdated. I find it most convenient to append this piece of code to runtests.jl.

1 Like