Skip to content

Commit 7a0ac83

Browse files
authored
Apply shared_docs_and_tests_workflows patch (#244)
1 parent 4b0ac08 commit 7a0ac83

File tree

7 files changed

+9
-114
lines changed

7 files changed

+9
-114
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "BlockSparseArrays"
22
uuid = "2c9a651f-6452-4ace-a6ac-809f4280fbb4"
3-
version = "0.10.33"
3+
version = "0.10.34"
44
authors = ["ITensor developers <support@itensor.org> and contributors"]
55

66
[workspace]

docs/Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
BlockArrays = "8e7c35d0-a365-5155-bbbb-fb81a777f24e"
33
BlockSparseArrays = "2c9a651f-6452-4ace-a6ac-809f4280fbb4"
44
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
5+
ITensorFormatter = "b6bf39f1-c9d3-4bad-aad8-593d802f65fd"
56
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
67

78
[sources.BlockSparseArrays]
@@ -11,4 +12,5 @@ path = ".."
1112
BlockArrays = "1"
1213
BlockSparseArrays = "0.10"
1314
Documenter = "1"
15+
ITensorFormatter = "0.2.27"
1416
Literate = "2"

docs/make.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using BlockSparseArrays: BlockSparseArrays
22
using Documenter: Documenter, DocMeta, deploydocs, makedocs
3+
using ITensorFormatter: ITensorFormatter
34

45
DocMeta.setdocmeta!(
56
BlockSparseArrays, :DocTestSetup, quote
@@ -8,7 +9,7 @@ DocMeta.setdocmeta!(
89
end; recursive = true
910
)
1011

11-
include("make_index.jl")
12+
ITensorFormatter.make_index!(pkgdir(BlockSparseArrays))
1213

1314
makedocs(;
1415
modules = [BlockSparseArrays],

docs/make_index.jl

Lines changed: 0 additions & 21 deletions
This file was deleted.

docs/make_readme.jl

Lines changed: 0 additions & 17 deletions
This file was deleted.

test/Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ BlockSparseArrays = "2c9a651f-6452-4ace-a6ac-809f4280fbb4"
77
DiagonalArrays = "74fd4be6-21e2-4f6f-823a-4360d37c7a77"
88
FunctionImplementations = "7c7cc465-9c6a-495f-bdd1-f42428e86d0c"
99
GPUArraysCore = "46192b85-c4d5-4398-a991-12ede77f4527"
10+
ITensorPkgSkeleton = "3d388ab1-018a-49f4-ae50-18094d5f71ea"
1011
JLArrays = "27aeb0d3-9eb9-45fb-866b-73c2ecf80fcb"
1112
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1213
MatrixAlgebraKit = "6c742aac-3347-4629-af66-fc926824e5e4"
@@ -32,6 +33,7 @@ BlockSparseArrays = "0.10"
3233
DiagonalArrays = "0.3"
3334
FunctionImplementations = "0.4"
3435
GPUArraysCore = "0.2"
36+
ITensorPkgSkeleton = "0.3.42"
3537
JLArrays = "0.2, 0.3"
3638
LinearAlgebra = "1"
3739
MatrixAlgebraKit = "0.6"

test/runtests.jl

Lines changed: 2 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,3 @@
1-
using SafeTestsets: @safetestset
2-
using Suppressor: Suppressor
1+
using ITensorPkgSkeleton: ITensorPkgSkeleton
32

4-
# check for filtered groups
5-
# either via `--group=ALL` or through ENV["GROUP"]
6-
const pat = r"(?:--group=)(\w+)"
7-
arg_id = findfirst(contains(pat), ARGS)
8-
const GROUP = uppercase(
9-
if isnothing(arg_id)
10-
arg = get(ENV, "GROUP", "ALL")
11-
# For some reason `ENV["GROUP"]` is set to `""`
12-
# when running via GitHub Actions, so handle that case:
13-
arg == "" ? "ALL" : arg
14-
else
15-
only(match(pat, ARGS[arg_id]).captures)
16-
end
17-
)
18-
19-
"""
20-
match files of the form `test_*.jl`, but exclude `*setup*.jl`
21-
"""
22-
function istestfile(path)
23-
fn = basename(path)
24-
return endswith(fn, ".jl") && startswith(basename(fn), "test_") &&
25-
!contains(fn, "setup")
26-
end
27-
"""
28-
match files of the form `*.jl`, but exclude `*_notest.jl` and `*setup*.jl`
29-
"""
30-
function isexamplefile(path)
31-
fn = basename(path)
32-
return endswith(fn, ".jl") && !endswith(fn, "_notest.jl") && !contains(fn, "setup")
33-
end
34-
35-
@time begin
36-
# tests in groups based on folder structure
37-
for testgroup in filter(isdir, readdir(@__DIR__; join = true))
38-
if GROUP == "ALL" || GROUP == uppercase(basename(testgroup))
39-
for filename in filter(istestfile, readdir(testgroup; join = true))
40-
@eval @safetestset $(basename(filename)) begin
41-
include($filename)
42-
end
43-
end
44-
end
45-
end
46-
47-
# single files in top folder
48-
for file in filter(istestfile, readdir(@__DIR__; join = true))
49-
(basename(file) == basename(@__FILE__)) && continue # exclude this file to avoid infinite recursion
50-
@eval @safetestset $(basename(file)) begin
51-
include($file)
52-
end
53-
end
54-
55-
# test examples
56-
examplepath = joinpath(@__DIR__, "..", "examples")
57-
for (root, _, files) in walkdir(examplepath)
58-
contains(chopprefix(root, @__DIR__), "setup") && continue
59-
for file in filter(isexamplefile, files)
60-
filename = joinpath(root, file)
61-
@eval begin
62-
@safetestset $file begin
63-
$(
64-
Expr(
65-
:macrocall,
66-
GlobalRef(Suppressor, Symbol("@suppress")),
67-
LineNumberNode(@__LINE__, @__FILE__),
68-
:(include($filename))
69-
)
70-
)
71-
end
72-
end
73-
end
74-
end
75-
end
3+
ITensorPkgSkeleton.runtests(; testdir = @__DIR__)

0 commit comments

Comments
 (0)