From 99f0218339f47ea390ea247cb58d22cfde100284 Mon Sep 17 00:00:00 2001 From: ChrisRackauckas-Claude Date: Wed, 22 Jul 2026 10:59:25 -0400 Subject: [PATCH] Skip rendered-doc checks for external reexports Co-Authored-By: Chris Rackauckas --- Project.toml | 2 +- src/SciMLTesting.jl | 18 ++++++++++++++---- test/runtests.jl | 9 +++++---- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/Project.toml b/Project.toml index 213cdf3..6a9b218 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "SciMLTesting" uuid = "09d9d899-5365-40a9-917a-5f67fddea283" authors = ["SciML"] -version = "2.4.0" +version = "2.4.1" [deps] Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" diff --git a/src/SciMLTesting.jl b/src/SciMLTesting.jl index 46d7b5c..c04272f 100644 --- a/src/SciMLTesting.jl +++ b/src/SciMLTesting.jl @@ -967,13 +967,23 @@ function _has_docstring(pkg::Module, name::Symbol) return !occursin("No documentation found", doc) end -# A re-exported module inherits its defining package's module documentation. -# Re-exported functions and types still require an explicit local API entry. +# Only names owned by this package's module hierarchy require a local rendered API +# entry. External public reexports are audited separately by `public_reexports`. function _requires_local_rendering(pkg::Module, name::Symbol) isdefined(pkg, name) || return true + binding_owner = try + which(pkg, name) + catch + pkg + end + _is_within_module(binding_owner, pkg) || return false value = getfield(pkg, name) - value isa Module || return true - return _is_within_module(value, pkg) + owner = try + value isa Module ? value : parentmodule(value) + catch + pkg + end + return _is_within_module(owner, pkg) end # The bare name referenced by one line inside a ```@docs``` fenced block. A `@docs` diff --git a/test/runtests.jl b/test/runtests.jl index df3f4e9..48ccf28 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1128,7 +1128,8 @@ end end @test c[:fail] == 0 && c[:pass] == 1 - # A re-exported module inherits its defining package's module documentation. + # External reexports are checked by public_reexports, not the local rendered + # API-doc requirement. rroot = mktempdir() rsrc = joinpath(rroot, "src"); mkpath(rsrc) c = counts_of() do @@ -1141,10 +1142,10 @@ end c = counts_of() do run_api_docs(FunctionReexportFixture; docstrings = false, docs_src = rsrc) end - @test c[:fail] == 1 && c[:error] == 0 && c[:pass] == 0 + @test c[:fail] == 0 && c[:error] == 0 && c[:pass] == 1 @test :run_qa in public_api_names(FunctionReexportFixture) - @test SciMLTesting._requires_local_rendering(FunctionReexportFixture, :run_qa) - @test SciMLTesting._requires_local_rendering(ComprehensiveReexportFixture, :OwnedType) + @test !SciMLTesting._requires_local_rendering(FunctionReexportFixture, :run_qa) + @test !SciMLTesting._requires_local_rendering(ComprehensiveReexportFixture, :OwnedType) @test SciMLTesting._requires_local_rendering(NestedOwnerFixture, :NestedModule) # A package-owned submodule remains part of this package's rendered manual.