Skip to content

Commit ab125b5

Browse files
committed
make JET and AllocCheck dependency optional
1 parent cd288f3 commit ab125b5

2 files changed

Lines changed: 16 additions & 6 deletions

File tree

test/Project.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@ name = "TensorKitTests"
22

33
[deps]
44
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
5-
AllocCheck = "9b6a8646-10ed-4001-bbdc-1d2f46dfbb1a"
65
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
76
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
87
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
98
ChainRulesTestUtils = "cdddcdb0-9152-4a09-a978-84456f9df70a"
109
Combinatorics = "861a8166-3701-5b0c-9a16-15d98fcdc6aa"
1110
FiniteDifferences = "26cc04aa-876d-5657-8c51-4c34ba976000"
1211
GPUArrays = "0c68f7d7-f131-5f86-a1c3-88cf8149b2d7"
13-
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
1412
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1513
MatrixAlgebraKit = "6c742aac-3347-4629-af66-fc926824e5e4"
1614
Mooncake = "da2b9cff-9c12-43a0-ae48-6db2b0edb7d6"
@@ -31,11 +29,9 @@ TensorKit = {path = ".."}
3129

3230
[compat]
3331
Aqua = "0.6, 0.7, 0.8"
34-
AllocCheck = "0.2"
3532
ChainRulesTestUtils = "1"
3633
Combinatorics = "1"
3734
GPUArrays = "11.3.1"
38-
JET = "0.9, 0.10, 0.11"
3935
ParallelTestRunner = "2"
4036
Test = "1"
4137
TestExtras = "0.2,0.3"

test/mooncake/tangent.jl

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,23 @@ using Test, TestExtras
22
using TensorKit
33
using Mooncake
44
using Random
5-
using JET, AllocCheck
65

7-
using .TestSetup: _repartition
6+
# Since we aren't actively depending on JET and AllocCheck, but only implicitly through the package extensions
7+
# of Mooncake, we don't want to break nightly tests etc. If this fails, tests still run but without the JET tests.
8+
const JET_AVAILABLE = let
9+
try
10+
import Pkg
11+
current = Base.active_project()
12+
Pkg.activate(; temp = true, io = devnull)
13+
Pkg.add(["JET", "AllocCheck"]; io = devnull)
14+
@eval using JET, AllocCheck
15+
Pkg.activate(current; io = devnull)
16+
true
17+
catch
18+
@warn "Cannot load JET and/or AllocCheck"
19+
false
20+
end
21+
end
822

923
mode = Mooncake.ReverseMode
1024
rng = Random.default_rng()

0 commit comments

Comments
 (0)