From de915ecf732d7ec46bdbfc4fbb72fa920f961416 Mon Sep 17 00:00:00 2001 From: ChrisRackauckas-Claude Date: Mon, 13 Jul 2026 05:50:09 -0400 Subject: [PATCH] Use shared public docs QA Replace the local public API docs scanner with SciMLTesting's rendered API docs check, and keep the change scoped to the QA docs environment. Co-Authored-By: Chris Rackauckas --- test/qa/Project.toml | 2 +- test/qa/public_api_docs.jl | 87 -------------------------------------- test/qa/qa.jl | 11 +++-- 3 files changed, 9 insertions(+), 91 deletions(-) delete mode 100644 test/qa/public_api_docs.jl diff --git a/test/qa/Project.toml b/test/qa/Project.toml index 9282b032..acf0ab98 100644 --- a/test/qa/Project.toml +++ b/test/qa/Project.toml @@ -13,5 +13,5 @@ Aqua = "0.8" ForwardDiff = "1" JET = "0.9, 0.10" SciMLBase = "3.30" -SciMLTesting = "1.7" +SciMLTesting = "2.1" StaticArrays = "1.9.14" diff --git a/test/qa/public_api_docs.jl b/test/qa/public_api_docs.jl deleted file mode 100644 index 76638744..00000000 --- a/test/qa/public_api_docs.jl +++ /dev/null @@ -1,87 +0,0 @@ -using DiffEqGPU, Test - -function docs_entries(root) - entries = Set{String}() - declarations = Set{String}() - in_docs_block = false - - md_files = String[] - for (dir, _, files) in walkdir(root) - append!(md_files, joinpath.(dir, filter(endswith(".md"), files))) - end - - for file in md_files - for line in eachline(file) - stripped = strip(line) - if stripped == "```@docs" - in_docs_block = true - continue - elseif startswith(stripped, "```") - in_docs_block = false - continue - end - - for m in eachmatch(r"`([A-Za-z_][A-Za-z_0-9!]*)(?:\([^`]*)?`", line) - push!(declarations, m.captures[1]) - end - - if in_docs_block && !isempty(stripped) - push!(entries, stripped) - push!(entries, last(split(stripped, "."))) - push!(declarations, stripped) - push!(declarations, last(split(stripped, "."))) - end - end - end - - return entries, declarations -end - -@testset "Public API docs coverage" begin - exported_names = setdiff(names(DiffEqGPU; all = false), (:DiffEqGPU,)) - missing_docstrings = Symbol[] - - for name in exported_names - Docs.hasdoc(DiffEqGPU, name) || push!(missing_docstrings, name) - end - - @test isempty(missing_docstrings) -end - -@testset "Rendered API docs coverage" begin - root = joinpath(pkgdir(DiffEqGPU), "docs", "src") - entries, declarations = docs_entries(root) - exported_names = setdiff(names(DiffEqGPU; all = false), (:DiffEqGPU,)) - - missing_export_declarations = Symbol[ - name for name in exported_names if String(name) ∉ declarations - ] - missing_owned_exports = Symbol[] - - for name in exported_names - binding = getproperty(DiffEqGPU, name) - parentmodule(binding) === DiffEqGPU || continue - String(name) ∈ entries || push!(missing_owned_exports, name) - end - - developer_interfaces = ( - :EnsembleArrayAlgorithm, - :EnsembleKernelAlgorithm, - :GPUODEAlgorithm, - :GPUSDEAlgorithm, - :GPUODEImplicitAlgorithm, - :AbstractNLSolver, - :AbstractNLSolverCache, - :NLSolver, - :vectorized_solve, - :vectorized_asolve, - :vectorized_map_solve, - ) - missing_developer_interfaces = Symbol[ - name for name in developer_interfaces if String(name) ∉ entries - ] - - @test isempty(missing_export_declarations) - @test isempty(missing_owned_exports) - @test isempty(missing_developer_interfaces) -end diff --git a/test/qa/qa.jl b/test/qa/qa.jl index ce871a24..717ed7ff 100644 --- a/test/qa/qa.jl +++ b/test/qa/qa.jl @@ -1,9 +1,16 @@ -using SciMLTesting, DiffEqGPU, Test +using SciMLTesting, DiffEqGPU using JET +const REEXPORTED_API = Tuple( + name for name in names(DiffEqGPU; all = false) if name !== :DiffEqGPU && + isdefined(DiffEqGPU, name) && + parentmodule(getfield(DiffEqGPU, name)) !== DiffEqGPU +) + run_qa( DiffEqGPU; explicit_imports = true, + api_docs_kwargs = (; rendered = true, rendered_ignore = REEXPORTED_API), ei_kwargs = (; # StaticVecOrMat is re-exported by StaticArrays but owned by StaticArraysCore. # It is a non-public type alias used only in method-signature dispatch for the @@ -49,5 +56,3 @@ run_qa( ), ), ) - -include("public_api_docs.jl")