From 7f728808842280c866744ff7d87c9f31bc6f75d1 Mon Sep 17 00:00:00 2001 From: ChrisRackauckas-Claude Date: Mon, 15 Jun 2026 10:40:06 -0400 Subject: [PATCH] Fix sublibrary QA Aqua piracy via treat_as_own for owned types The ArrayPartitionAnyAll and ShorthandConstructors sublibrary QA groups (added in #614) fail Aqua's piracy check because they extend Base functions on RecursiveArrayTools-owned types: * ArrayPartitionAnyAll: any/all on ArrayPartition * ShorthandConstructors: getindex(::Type{VA}, ...), getindex(::Type{AP}, ...) These are intentional methods on types the sublibraries hard-depend on, not type piracy. Pass them via Aqua.test_all(...; piracies = (; treat_as_own = ...)) so the owned-type extensions are not flagged. Co-Authored-By: Chris Rackauckas Co-Authored-By: Claude Opus 4.8 (1M context) --- lib/RecursiveArrayToolsArrayPartitionAnyAll/test/qa/qa.jl | 6 +++++- lib/RecursiveArrayToolsShorthandConstructors/test/qa/qa.jl | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/RecursiveArrayToolsArrayPartitionAnyAll/test/qa/qa.jl b/lib/RecursiveArrayToolsArrayPartitionAnyAll/test/qa/qa.jl index 0a53d9f3..c2ed190d 100644 --- a/lib/RecursiveArrayToolsArrayPartitionAnyAll/test/qa/qa.jl +++ b/lib/RecursiveArrayToolsArrayPartitionAnyAll/test/qa/qa.jl @@ -1,8 +1,12 @@ using RecursiveArrayToolsArrayPartitionAnyAll, Aqua, JET, Test +const RATAPAA = RecursiveArrayToolsArrayPartitionAnyAll + @testset "QA" begin @testset "Aqua" begin - Aqua.test_all(RecursiveArrayToolsArrayPartitionAnyAll) + # `any`/`all` are extended on the RecursiveArrayTools-owned `ArrayPartition` + # type, so they are intentional (owned) methods, not piracy. + Aqua.test_all(RATAPAA; piracies = (; treat_as_own = [RATAPAA.ArrayPartition])) end @testset "JET" begin JET.test_package(RecursiveArrayToolsArrayPartitionAnyAll; target_defined_modules = true) diff --git a/lib/RecursiveArrayToolsShorthandConstructors/test/qa/qa.jl b/lib/RecursiveArrayToolsShorthandConstructors/test/qa/qa.jl index 74f2c270..82a07544 100644 --- a/lib/RecursiveArrayToolsShorthandConstructors/test/qa/qa.jl +++ b/lib/RecursiveArrayToolsShorthandConstructors/test/qa/qa.jl @@ -1,8 +1,13 @@ using RecursiveArrayToolsShorthandConstructors, Aqua, JET, Test +const RATSC = RecursiveArrayToolsShorthandConstructors + @testset "QA" begin @testset "Aqua" begin - Aqua.test_all(RecursiveArrayToolsShorthandConstructors) + # `getindex(::Type{VA}, ...)` / `getindex(::Type{AP}, ...)` extend Base on + # RecursiveArrayTools-owned types, so they are intentional (owned) methods, + # not piracy. + Aqua.test_all(RATSC; piracies = (; treat_as_own = [RATSC.VA, RATSC.AP])) end @testset "JET" begin JET.test_package(RecursiveArrayToolsShorthandConstructors; target_defined_modules = true)