Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce duplication in doctest setup #1897

Open
fingolfin opened this issue Nov 10, 2024 · 0 comments
Open

Reduce duplication in doctest setup #1897

fingolfin opened this issue Nov 10, 2024 · 0 comments

Comments

@fingolfin
Copy link
Member

From docs/make.jl:

# We do *not* call `DocMeta.setdocmeta!` with value `:(using AbstractAlgebra)`
# because we want to force that each jldoctest has its individual
# `setup = :(using AbstractAlgebra)`.
# The reason is that the AbstractAlgebra doctests are run also in Nemo,
# where `using AbstractAlgebra` must be avoided, as a few symbols change
# their meaning, e.g. `QQ`.

As a result we are duplicating this line again and again in src which is rather annoying:

```jldoctest; setup = :(using AbstractAlgebra; AbstractAlgebra.set_current_module(@__MODULE__))

Ideally we would replace the comment in docs/make.jl by something like this:

DocMeta.setdocmeta!(AbstractAlgebra, :DocTestSetup, AbstractAlgebra.doctestsetup(); recursive = true)

But if we do that, then (at least in the past) the CI tests for Nemo, Hecke, Oscar may fail. This is because there this is done instead:

DocMeta.setdocmeta!(Nemo, :DocTestSetup, :(using Nemo); recursive = true)

Yet at least some of the AA doctests are also run by the Nemo/Hecke/Oscar CI. They now have a different setup block and as such, at least some of them run into test failures.

A potential fix might be to do something like this in Nemo (and then similar in Hecke, Oscar):

DocMeta.setdocmeta!(Nemo, :DocTestSetup, :(using Nemo); recursive = true)
DocMeta.setdocmeta!(Nemo.AbstractAlgebra, :DocTestSetup, Nemo.AbstractAlgebra.doctestsetup(); recursive = true)

But someone needs to experiment with this, once there is an AA releases with doctestsetup() available.

(And then we probably should also add Hecke.doctestsetup())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant