Repository navigation
QA: add ExplicitImports checks; declare init/get_expression public - #133
Merged
ChrisRackauckas merged 3 commits intoJun 26, 2026
Merged
Conversation
Wire the full set of ExplicitImports checks into the QA test group and fix the import hygiene they surface: - Implicit -> explicit: replace `using ExprTools, Serialization, SHA` with per-name `using Dep: name` imports (combinedef/splitdef, SHA1_CTX/update!, AbstractSerializer/deserialize/serialize). - Remove stale `import Base.Experimental: @opaque` (the macro is never invoked; closures_to_opaque builds the macrocall expr manually). This also clears the lone non-public explicit import. - Declare `init` and `get_expression` public (Julia >= 1.11, guarded) since they are documented, downstream-relied-on entry points. High-leverage for the fleet: downstream packages qualifying these now pass check_all_qualified_accesses_are_public against this library. The only remaining non-public qualified accesses are `Base.deepcopy_internal` and `Serialization.serialize_type` -- the documented-by-convention extension points for customizing deepcopy/serialization. Neither owner marks them public and there is no public alternative, so they are minimally ignore-listed with a comment rather than rewritten. All 6 checks pass locally on Julia lts (1.10) and 1 (1.12). Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replace the direct Aqua/ExplicitImports calls in test/qa/qa.jl with a single run_qa(RuntimeGeneratedFunctions; Aqua, ExplicitImports, explicit_imports=true, ei_kwargs=...) call, the canonical SciMLTesting QA body. The per-check ignore list for check_all_qualified_accesses_are_public (:deepcopy_internal, :serialize_type) is carried over verbatim via ei_kwargs. The init/get_expression public declarations and all other PR fixes are retained. Bump SciMLTesting [compat] to "1.4" in Project.toml and test/qa/Project.toml, since run_qa's ExplicitImports support was introduced in SciMLTesting 1.4.0. Verified locally on Julia 1.10 (lts) and 1.12 (the "1" channel): the QA group passes 17/17 (all 6 ExplicitImports checks plus Aqua) via run_qa. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Member
Author
|
Canonicalized the QA body to SciMLTesting's
Verified locally on Julia 1.10 (lts) and 1.12 (the |
SciMLTesting 1.5.0 makes Aqua and ExplicitImports its own direct dependencies and auto-detects them in run_qa, so the per-repo QA body no longer threads them through: - test/qa/qa.jl: drop the now-auto-detected `Aqua = Aqua` and `ExplicitImports = ExplicitImports` module arguments. Keep `explicit_imports = true` (the ExplicitImports checks are opt-in as of 1.5, defaulting off) and the per-check `ei_kwargs` ignore-list verbatim. Imports collapse to `using RuntimeGeneratedFunctions, SciMLTesting, Test`. - test/qa/Project.toml: drop ExplicitImports (now transitive via SciMLTesting). KEEP Aqua as a direct dep: Aqua's `test_ambiguities` runs `detect_ambiguities` in a child process that does `using Aqua`, which requires Aqua to be a direct dependency of the active QA environment -- a transitive-only Aqua makes that subprocess fail with "Package Aqua not found in current path" (verified reproducible on Julia 1.10 and 1.11). ExplicitImports has no such subprocess and works transitively. - Project.toml: drop Aqua and ExplicitImports from the root [extras]/[targets] test set (the root test target runs neither; QA is the separate test/qa sub-env). - Bump SciMLTesting [compat] to "1.5" in both Project.toml and test/qa/Project.toml. Verified locally against the released SciMLTesting 1.5.0 (no dev-from-branch): GROUP=QA `Pkg.test` passes 17/17 on Julia 1.10 (lts) and 1.12 (the "1" channel) -- all six ExplicitImports checks plus Aqua's full test_all. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ChrisRackauckas
marked this pull request as ready for review
June 26, 2026 00:38
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 until reviewed by @ChrisRackauckas.
Part of the SciML CI/QA-greening campaign. Adds the full approved set of
ExplicitImports.jl checks
to the QA test group and fixes the import-hygiene issues they surface. As a
foundational base library, getting RuntimeGeneratedFunctions' own public-API
declarations right is high-leverage: it lets downstream SciML repos that access
RuntimeGeneratedFunctions.init/RuntimeGeneratedFunctions.get_expressionpass
check_all_qualified_accesses_are_publicagainst this package.Checks wired in (
test/qa/qa.jl)All six, as direct
@test ... === nothingcalls alongside the existing Aqua block:check_no_implicit_importscheck_no_stale_explicit_importscheck_all_explicit_imports_via_ownerscheck_all_qualified_accesses_via_ownerscheck_all_qualified_accesses_are_public(with a minimal, documented ignore-list)check_all_explicit_imports_are_publicViolations found (before) and how each was handled
using ExprTools, Serialization, SHA→ explicitusing Dep: name@opaque)import Base.Experimental: @opaque@opaque)Fixed (implicit → explicit)
ExprTools:combinedef,splitdefSHA:SHA1_CTX,update!Serialization:AbstractSerializer,deserialize,serializeRemoved stale import
import Base.Experimental: @opaque— the macro is never invoked.closures_to_opaqueconstructs the
@opaquemacrocall expression manually viaExpr(:., Expr(:., :Base, QuoteNode(:Experimental)), QuoteNode(Symbol("@opaque"))),so the bare import was dead. Removing it also clears the only non-public explicit import.
Declared public (this package's own API)
initandget_expressionare documented (README + the@autodocsAPI page,both carry docstrings) and relied on by downstreams, but intentionally not
exported so they stay namespaced under
RuntimeGeneratedFunctions.. Declaringthem
public(guarded for Julia 1.10) makes that intent explicit withoutchanging the export surface. Verified on 1.12 that
Base.ispublicreturnstruefor both, and a no-op on 1.10.Ignore-listed (unavoidable, dep hasn't marked public)
check_all_qualified_accesses_are_public(...; ignore = (:deepcopy_internal, :serialize_type))Base.deepcopy_internal— the by-convention extension point overridden to getdeepcopy(f) === ffor RGFs. Not public inBase; no public alternative.Serialization.serialize_type— the standard custom-serialization extensionpoint used in the bespoke
Serialization.serializemethod. Not public inSerialization; no public alternative.Project.toml
Added
ExplicitImportsto[compat]("1"),[extras],[targets].testin theroot, and to the QA sub-environment (
test/qa/Project.toml). Bumped version0.5.20 → 0.5.21. No
test/Project.tomlwas created.Local verification
Both groups pass on Julia lts (1.10) and Julia 1 (1.12):
Core group (
GROUP=Core) also passes unchanged. Runic clean on the modified files.🤖 Generated with Claude Code