Add ExplicitImports.jl checks to QA via SciMLTesting run_qa#161
Merged
ChrisRackauckas merged 2 commits intoJun 27, 2026
Merged
Conversation
Wire ExplicitImports.jl into the QA group through SciMLTesting 1.4's `run_qa(...; ExplicitImports, explicit_imports=true, ei_kwargs=...)`, running all six checks (no_implicit_imports, no_stale_explicit_imports, all_explicit_imports_via_owners, all_qualified_accesses_via_owners, all_qualified_accesses_are_public, all_explicit_imports_are_public). Changes: - test/qa/qa.jl: replace the hand-written Aqua/JET testsets with a single run_qa call that keeps Aqua (deps_compat check_extras=false) and JET (target_defined_modules=true), and adds the ExplicitImports checks. - test/qa/Project.toml: add ExplicitImports dep + compat; bump SciMLTesting compat to 1.4 (run_qa's ExplicitImports support). - Project.toml: bump SciMLTesting compat to 1.4; patch version 1.22.2. - src/compat.jl: `Base.isexpr` -> `Base.Meta.isexpr` so the qualified access resolves to the public `Base.Meta` owner (FIX, no ignore needed on any version). Behaviorally identical (Meta.isexpr === Base.isexpr). - ext/ADTypesChainRulesCoreExt.jl: drop unused `NoForwardsMode`/`NoReverseMode` imports (stale-explicit-imports cleanup). Only two unavoidable non-public Base names are ignored, and only in the public-API access check: `broadcastable` (the documented broadcasting hook, non-public in every Julia version) and `depwarn` (non-public on the 1.10 LTS, public on 1.11+). Every other check passes with no ignore-list. Verified locally: QA group 17/17 on Julia 1.10, 1.11, 1.12; all six ExplicitImports checks PASS individually on 1.10 and 1.11; Core tests (Dense/Sparse/Symbols/Legacy/Misc/Public) still pass on 1.11. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
SciMLTesting 1.5.0 makes Aqua and ExplicitImports its own direct deps and
auto-detects them, with JET still a weakdep (opt-in via `using JET`).
`explicit_imports` stays an explicit opt-in (defaults false).
- test/qa/qa.jl: collapse to the minimal form. Imports become
`using SciMLTesting, ADTypes, Test` + `using JET`; drop `using Aqua` and
`using ExplicitImports`. The run_qa call drops the now-auto-detected
`Aqua = Aqua`, `JET = JET`, `jet = true`, and `ExplicitImports = ExplicitImports`
module args, keeping only the genuine per-repo overrides
(aqua_kwargs, jet_kwargs, explicit_imports = true, ei_kwargs).
- test/qa/Project.toml: drop ExplicitImports from [deps]/[compat] (now
transitive via SciMLTesting); bump SciMLTesting compat to 1.5. Aqua is kept
as a direct dep on purpose: Aqua's ambiguity check spawns a worker
subprocess that runs a bare `using Aqua` against the active project, which
errors ("Package Aqua not found in current path") if Aqua is only a
transitive (manifest-only) dep. JET is kept (the qa runs JET).
- Project.toml: bump SciMLTesting compat to 1.5.
Verified locally against the released SciMLTesting 1.5.0 (Pkg-resolved, no
dev-from-branch): QA group 17/17 on Julia 1.10 and 1.11, running the same
checks as before — all Aqua checks (incl. Method ambiguity), the six
ExplicitImports checks, and JET.test_package.
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Please ignore this PR until it has been reviewed by @ChrisRackauckas.
What
Adds ExplicitImports.jl to the QA group via SciMLTesting 1.4's
run_qa, running all six checks and making them pass:no_implicit_importsno_stale_explicit_importsall_explicit_imports_via_ownersall_qualified_accesses_via_ownersall_qualified_accesses_are_publicall_explicit_imports_are_publicrun_qaalso replaces the hand-written Aqua/JET testsets, preserving the exact prior behavior: Aqua withdeps_compat = (check_extras = false,)and JET withtarget_defined_modules = true.Changes
test/qa/qa.jl— switch torun_qa(ADTypes; Aqua, aqua_kwargs, JET, jet=true, jet_kwargs, ExplicitImports, explicit_imports=true, ei_kwargs=...).test/qa/Project.toml— addExplicitImports(dep + compat1.11); bumpSciMLTestingcompat to1.4.Project.toml— bumpSciMLTestingcompat to1.4; patch version1.22.1 -> 1.22.2.src/compat.jl(FIX) —Base.isexpr->Base.Meta.isexprin the@publicmacro.Meta.isexpr === Base.isexpr, andisexpris publicly owned byBase.Metaon every supported Julia version, so the qualified access resolves to a public owner and needs no ignore. Behaviorally identical.ext/ADTypesChainRulesCoreExt.jl(FIX) — drop the unusedNoForwardsMode/NoReverseModeimports flagged as stale explicit imports.Priority: FIX > DECLARE-PUBLIC > minimal-IGNORE
FIX: stale-import removal in the ChainRules extension;
Base.isexpr->Base.Meta.isexpr.DECLARE-PUBLIC: the package's intended-public-but-unexported surface is already declared via the
@publicmacro (AbstractMode,ForwardMode,mode,Auto,dense_ad, sparsity/coloring helpers, ...) — no change needed; the public-API checks confirm it.IGNORE (minimal, documented, public-API access check only):
broadcastable—Base.broadcastable(ad::AbstractADType) = Ref(ad)is the documented broadcasting customization hook;Basemarks it non-public on every Julia version, so extending it is an unavoidable non-public qualified access.depwarn—Base.depwarnis the only way to emit a deprecation warning and is non-public on the 1.10 LTS (it became public inBaseon 1.11+, where ignoring it is a harmless no-op).Every other ExplicitImports check passes with no ignore-list.
Verification (local)
Core tests (Dense 156, Sparse 185, Symbols 20, Legacy 41, Miscellaneous 104, Public 1) still pass on 1.11 — confirms the
@publicmacroMeta.isexprchange and the extension import cleanup are non-breaking.🤖 Generated with Claude Code