Skip to content

Add ExplicitImports.jl checks to QA via SciMLTesting run_qa#161

Merged
ChrisRackauckas merged 2 commits into
SciML:mainfrom
ChrisRackauckas-Claude:explicit-imports-qa
Jun 27, 2026
Merged

Add ExplicitImports.jl checks to QA via SciMLTesting run_qa#161
ChrisRackauckas merged 2 commits into
SciML:mainfrom
ChrisRackauckas-Claude:explicit-imports-qa

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Contributor

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_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

run_qa also replaces the hand-written Aqua/JET testsets, preserving the exact prior behavior: Aqua with deps_compat = (check_extras = false,) and JET with target_defined_modules = true.

Changes

  • test/qa/qa.jl — switch to run_qa(ADTypes; Aqua, aqua_kwargs, JET, jet=true, jet_kwargs, ExplicitImports, explicit_imports=true, ei_kwargs=...).
  • test/qa/Project.toml — add ExplicitImports (dep + compat 1.11); bump SciMLTesting compat to 1.4.
  • Project.toml — bump SciMLTesting compat to 1.4; patch version 1.22.1 -> 1.22.2.
  • src/compat.jl (FIX) — Base.isexpr -> Base.Meta.isexpr in the @public macro. Meta.isexpr === Base.isexpr, and isexpr is publicly owned by Base.Meta on 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 unused NoForwardsMode/NoReverseMode imports 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 @public macro (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):

    • broadcastableBase.broadcastable(ad::AbstractADType) = Ref(ad) is the documented broadcasting customization hook; Base marks it non-public on every Julia version, so extending it is an unavoidable non-public qualified access.
    • depwarnBase.depwarn is the only way to emit a deprecation warning and is non-public on the 1.10 LTS (it became public in Base on 1.11+, where ignoring it is a harmless no-op).

    Every other ExplicitImports check passes with no ignore-list.

Verification (local)

Julia QA group ExplicitImports (6 checks)
1.10 (LTS) 17/17 pass all 6 PASS
1.11 17/17 pass all 6 PASS
1.12 (release) 17/17 pass (run via run_qa)

Core tests (Dense 156, Sparse 185, Symbols 20, Legacy 41, Miscellaneous 104, Public 1) still pass on 1.11 — confirms the @public macro Meta.isexpr change and the extension import cleanup are non-breaking.

🤖 Generated with Claude Code

ChrisRackauckas and others added 2 commits June 24, 2026 11:31
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>
@ChrisRackauckas ChrisRackauckas marked this pull request as ready for review June 27, 2026 13:04
@ChrisRackauckas ChrisRackauckas merged commit 6db9608 into SciML:main Jun 27, 2026
10 checks passed
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

Successfully merging this pull request may close these issues.

2 participants