diff --git a/Project.toml b/Project.toml index 111b84f..8e7206c 100644 --- a/Project.toml +++ b/Project.toml @@ -3,16 +3,19 @@ uuid = "621f4979-c628-5d54-868e-fcf4e3e8185c" version = "1.3.1" [deps] +ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" -Requires = "ae029012-a4dd-5104-9daa-d747884805df" -[compat] -ChainRulesCore = "1" -julia = "^1.0" +[weakdeps] +ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" [extensions] AbstractFFTsChainRulesCoreExt = "ChainRulesCore" +[compat] +ChainRulesCore = "1" +julia = "^1.0" + [extras] ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" ChainRulesTestUtils = "cdddcdb0-9152-4a09-a978-84456f9df70a" @@ -22,6 +25,3 @@ Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d" [targets] test = ["ChainRulesCore", "ChainRulesTestUtils", "Random", "Test", "Unitful"] - -[weakdeps] -ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" diff --git a/src/AbstractFFTs.jl b/src/AbstractFFTs.jl index 77e194b..00f6dc2 100644 --- a/src/AbstractFFTs.jl +++ b/src/AbstractFFTs.jl @@ -7,16 +7,8 @@ export fft, ifft, bfft, fft!, ifft!, bfft!, include("definitions.jl") -@static if !isdefined(Base, :get_extension) - import Requires -end - -@static if !isdefined(Base, :get_extension) - function __init__() - Requires.@require ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" begin - include("../ext/AbstractFFTsChainRulesCoreExt.jl") - end - end +if !isdefined(Base, :get_extension) + include("../ext/AbstractFFTsChainRulesCoreExt.jl") end end # module diff --git a/test/runtests.jl b/test/runtests.jl index c41debe..9cb528a 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -2,6 +2,7 @@ using AbstractFFTs using AbstractFFTs: Plan +using ChainRulesTestUtils using LinearAlgebra using Random @@ -240,19 +241,6 @@ end end @testset "ChainRules" begin - - if isdefined(Base, :get_extension) - CRCEXT = Base.get_extension(AbstractFFTs, :AbstractFFTsChainRulesCoreExt) - @test isnothing(CRCEXT) - end - - using ChainRulesTestUtils - - if isdefined(Base, :get_extension) - CRCEXT = Base.get_extension(AbstractFFTs, :AbstractFFTsChainRulesCoreExt) - @test !isnothing(CRCEXT) - end - @testset "shift functions" begin for x in (randn(3), randn(3, 4), randn(3, 4, 5)) for dims in ((), 1, 2, (1,2), 1:2)