From 070fa5c1f3009753fe9cb971a0a06b5d73aee32a Mon Sep 17 00:00:00 2001 From: David Widmann Date: Tue, 27 Jun 2023 01:44:47 +0200 Subject: [PATCH] Revert "put chainrules core in a requires block, rm it from deps (#107)" This reverts commit 3a3f0e4ebc3a9ab81bfb655003759ffa9c6bd1bb. --- Project.toml | 14 +++++++------- src/AbstractFFTs.jl | 12 ++---------- test/runtests.jl | 14 +------------- 3 files changed, 10 insertions(+), 30 deletions(-) diff --git a/Project.toml b/Project.toml index 111b84f2..8e7206c1 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 77e194b0..00f6dc27 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 c41debe6..9cb528ac 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)