Add ExplicitImports.jl checks to QA via SciMLTesting run_qa#59
Conversation
Wire all six ExplicitImports.jl 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) into the QA group through SciMLTesting's `run_qa(...; ExplicitImports = ExplicitImports, explicit_imports = true, ei_kwargs = ...)`. The four standard checks and `no_implicit_imports` pass with no configuration. The two public-API checks flag two internal `Core` accesses inherent to `hasbranching` (a compiler-introspection utility): `Core.GotoIfNot` (the IR node it scans for) and `Core.Typeof` (used to build the dispatch signature tuple for `code_typed`). Neither has a public equivalent — `typeof` differs from `Core.Typeof` on type-valued arguments and `Base.typesof` is itself non-public — so they are added to a minimal, documented per-check ignore-list rather than rewritten. Also fold Aqua and JET into the same `run_qa` call and drop the two stale `@test_broken false` placeholders (issues from SciML#54): Aqua now passes with deps_compat enabled (root Project.toml carries compat for all test extras) and JET typo-mode passes (Cassette was replaced with `code_typed` in SciML#55), so those placeholders would now error as unexpected passes. Test deps: add ExplicitImports (compat 1.15) to test/qa/Project.toml and bump SciMLTesting floor to 1.4 (run_qa ExplicitImports support). Verified locally on Julia 1.12 (`GROUP=QA Pkg.test`): QA group 18/18 pass, all six ExplicitImports checks green. 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 in run_qa, so the per-repo qa.jl no longer threads those
modules. Collapse the call to its genuine per-repo content:
- qa.jl imports: `using SciMLTesting, FunctionProperties, JET, Test`
(drop `using Aqua, ExplicitImports` — now SciMLTesting deps; JET stays
since its weakdep extension must be loaded to enable the JET check).
- run_qa: keep `explicit_imports = true` (opt-in; defaults false in 1.5)
and the per-check `ei_kwargs` ignore-lists for the two `Core` accesses
inherent to `hasbranching`. Drop the now-auto-detected `Aqua = Aqua`,
`JET = JET, jet = true`, and `ExplicitImports = ExplicitImports`.
- test/qa/Project.toml: drop ExplicitImports (now transitive via
SciMLTesting); bump SciMLTesting floor to 1.5. Root Project.toml
SciMLTesting compat bumped to 1.5 as well.
Aqua is intentionally KEPT as a direct dep of test/qa/Project.toml even
though it is now also transitive: Aqua's `Method ambiguity` check spawns a
fresh subprocess that does `using Aqua` against this env's active-project
load path, where only direct deps resolve. Dropping it makes that one check
error with "Package Aqua not found in current path" while every other Aqua
check (run in-process via SciMLTesting's own Aqua) and the six
ExplicitImports checks still pass — so Aqua must remain listed here. (A
load-path fix for the ambiguity subprocess belongs upstream in SciMLTesting;
until then the direct-dep entry is required.)
Verified locally against the released SciMLTesting 1.5.0 (GROUP=QA Pkg.test):
QA group 18/18 on both Julia 1.10 (lts) and 1.12 — Aqua 11/11 (incl. Method
ambiguity), JET 1/1, ExplicitImports 6/6. Same checks/coverage as before.
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Converted the QA group to the SciMLTesting 1.5.0 qa.jl collapses to: using SciMLTesting, FunctionProperties, JET, Test
run_qa(FunctionProperties; explicit_imports = true,
ei_kwargs = (; all_explicit_imports_are_public = (; ignore = (:GotoIfNot,)),
all_qualified_accesses_are_public = (; ignore = (:Typeof,))))Aqua and ExplicitImports are SciMLTesting 1.5 direct deps and are auto-detected, so they are no longer threaded as module args. Deps: dropped Aqua kept as a direct dep on purpose. Dropping Aqua from Verified locally against released SciMLTesting 1.5.0 (
Same checks and coverage as the previous commit. Branch was already current with |
Note
Please ignore this PR until it has been reviewed by @ChrisRackauckas.
What
Wires all six ExplicitImports.jl checks into the
QAtest group through SciMLTesting'srun_qa(...; ExplicitImports = ExplicitImports, explicit_imports = true, ei_kwargs = ...):no_implicit_importsno_stale_explicit_importsall_explicit_imports_via_ownersall_qualified_accesses_via_ownersall_qualified_accesses_are_publicall_explicit_imports_are_publicViolations and how they were resolved (FIX > DECLARE-PUBLIC > IGNORE)
print_explicit_imports(FunctionProperties; report_non_public = true)surfaced exactly two violations, both internalCoreaccesses inherent tohasbranching, which is a compiler-introspection utility:Core.GotoIfNotusing Core: GotoIfNot(src line 3)all_explicit_imports_are_publicCore.TypeofCore.Typeof.(x)(src line 47)all_qualified_accesses_are_publicNeither can be cleanly fixed:
Core.GotoIfNotis the IR node type thathasbranchingscanscode_typedoutput for. It is non-public inCoreand has no public alias.Core.Typeofbuilds the dispatch-signature tuple type passed tocode_typed. It is not interchangeable with the publictypeof: for a type-valued argumentx = Int,Core.Typeof(Int)isType{Int64}(the dispatch signature) whiletypeof(Int)isDataType. The equivalentBase.typesofis itself non-public, so swapping would just relocate the violation.Both are therefore added to a minimal, documented per-check
ei_kwargsignore-list (the source line itself is unchanged, so no behavior change). FunctionProperties has no genuinely-public-but-unexported names of its own, so nopublic/exportdeclarations were needed.Also in this PR
Folds Aqua and JET into the same
run_qacall and drops the two stale@test_broken falseplaceholders (the#54workarounds):deps_compatenabled — the rootProject.tomlalready carries[compat]for every test extra, so thedeps_compat = falseworkaround is obsolete.Cassette.m is not definedfailure was eliminated when Fix Julia 1.12: replace Cassette with code_typed-based branch detection #55 replaced Cassette withcode_typed.Leaving
@test_broken falsein place would now error as an unexpected pass, so removing the placeholders and running the real checks is the correct fix.Test deps
test/qa/Project.toml: addExplicitImports(compat1.15), bumpSciMLTestingfloor to1.4(the release whoserun_qasupports ExplicitImports).Project.toml: bumpSciMLTestingcompat floor to1.4.Verification (local, Julia 1.12)
GROUP=QA julia --project=. -e 'using Pkg; withenv("GROUP"=>"QA") do; Pkg.test("FunctionProperties"); end':The six ExplicitImports checks individually (with the configured ignores):
Runic-clean.
🤖 Generated with Claude Code