Pkg extensions backwards compatibility + Aqua = failed test

I have a package that I’m trying to test with Aqua. This package has some extensions that I want to support on older Julia versions. So, as recommended here in the Pkg docs I have the lines

if !isdefined(Base, :get_extension)
    using Requires
end

This seems to mean that I also have to have

[deps]
...
Requires = "ae029012-a4dd-5104-9daa-d747884805df"

in my Project.toml. That seems to work fine; everything seems to run as needed on various Julia versions.

But now, I run the Aqua tests on Julia 1.9, and get it complaining that I have a stale dependency:

Stale dependencies: Test Failed at /Users/me/.julia/packages/Aqua/9p8ck/src/stale_deps.jl:31
  Expression: isempty(stale_deps)
   Evaluated: isempty(Base.PkgId[Requires [ae029012-a4dd-5104-9daa-d747884805df]])

Obviously, Requires is never loaded in Julia 1.9, so this makes sense.

How do I handle this? Should I just disable the test for stale dependencies?

Make the Aqua test conditional on Julia version?

You can use the ignore keyword argument: Stale dependencies · Aqua.jl

2 Likes

Ah, yes! Thank you very much!

And now that I have a more specific search, I find the solution I’ll use in the issues:

Aqua.test_all(TestedPackage; stale_deps=(;ignore=[:Requires]))