Skip to content

Commit

Permalink
Revert "put chainrules core in a requires block, rm it from deps (#107)…
Browse files Browse the repository at this point in the history
…" (#108)

This reverts commit 3a3f0e4.
  • Loading branch information
devmotion authored Jun 27, 2023
1 parent 27c37a0 commit 48a5d1c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 30 deletions.
14 changes: 7 additions & 7 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -22,6 +25,3 @@ Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"

[targets]
test = ["ChainRulesCore", "ChainRulesTestUtils", "Random", "Test", "Unitful"]

[weakdeps]
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
12 changes: 2 additions & 10 deletions src/AbstractFFTs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 1 addition & 13 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

using AbstractFFTs
using AbstractFFTs: Plan
using ChainRulesTestUtils

using LinearAlgebra
using Random
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 48a5d1c

Please sign in to comment.