Skip to content

Commit b3c4f5a

Browse files
authored
Update skeleton (#4)
1 parent 4cc3ccb commit b3c4f5a

File tree

9 files changed

+91
-29
lines changed

9 files changed

+91
-29
lines changed

.github/workflows/Documentation.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ jobs:
1919
uses: "ITensor/ITensorActions/.github/workflows/Documentation.yml@main"
2020
with:
2121
localregistry: https://github.com/ITensor/ITensorRegistry.git
22-
secrets: "inherit"
22+
secrets:
23+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.pre-commit-config.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.5.0
3+
rev: v5.0.0
44
hooks:
55
- id: check-merge-conflict
66
- id: check-toml
77
- id: check-yaml
88
- id: end-of-file-fixer
99
exclude_types: [markdown] # incompatible with Literate.jl
10-
- repo: https://github.com/qiaojunfeng/pre-commit-julia-format
11-
rev: v0.2.0
10+
11+
- repo: "https://github.com/domluna/JuliaFormatter.jl"
12+
rev: v2.0.0
1213
hooks:
13-
- id: julia-format
14+
- id: "julia-formatter"

Project.toml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,4 @@ authors = ["ITensor developers <[email protected]> and contributors"]
44
version = "0.1.0"
55

66
[compat]
7-
Aqua = "0.8.9"
8-
Test = "1.10"
97
julia = "1.10"
10-
11-
[extras]
12-
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
13-
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
14-
15-
[targets]
16-
test = ["Aqua", "Test"]

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://ITensor.github.io/FusionTensors.jl/stable/)
44
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://ITensor.github.io/FusionTensors.jl/dev/)
5-
[![Build Status](https://github.com/ITensor/FusionTensors.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/ITensor/FusionTensors.jl/actions/workflows/CI.yml?query=branch%3Amain)
5+
[![Build Status](https://github.com/ITensor/FusionTensors.jl/actions/workflows/Tests.yml/badge.svg?branch=main)](https://github.com/ITensor/FusionTensors.jl/actions/workflows/Tests.yml?query=branch%3Amain)
66
[![Coverage](https://codecov.io/gh/ITensor/FusionTensors.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/ITensor/FusionTensors.jl)
77
[![Code Style: Blue](https://img.shields.io/badge/code%20style-blue-4495d1.svg)](https://github.com/invenia/BlueStyle)
88
[![Aqua](https://raw.githubusercontent.com/JuliaTesting/Aqua.jl/master/badge.svg)](https://github.com/JuliaTesting/Aqua.jl)
@@ -17,6 +17,12 @@ julia> using Pkg: Pkg
1717

1818
julia> Pkg.Registry.add(url="https://github.com/ITensor/ITensorRegistry")
1919
```
20+
or:
21+
```julia
22+
julia> Pkg.Registry.add(url="[email protected]:ITensor/ITensorRegistry.git")
23+
```
24+
if you want to use SSH credentials, which can make it so you don't have to enter your Github ursername and password when registering packages.
25+
2026
Then, the package can be added as usual through the package manager:
2127

2228
```julia

examples/README.jl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# [![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://ITensor.github.io/FusionTensors.jl/stable/)
44
# [![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://ITensor.github.io/FusionTensors.jl/dev/)
5-
# [![Build Status](https://github.com/ITensor/FusionTensors.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/ITensor/FusionTensors.jl/actions/workflows/CI.yml?query=branch%3Amain)
5+
# [![Build Status](https://github.com/ITensor/FusionTensors.jl/actions/workflows/Tests.yml/badge.svg?branch=main)](https://github.com/ITensor/FusionTensors.jl/actions/workflows/Tests.yml?query=branch%3Amain)
66
# [![Coverage](https://codecov.io/gh/ITensor/FusionTensors.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/ITensor/FusionTensors.jl)
77
# [![Code Style: Blue](https://img.shields.io/badge/code%20style-blue-4495d1.svg)](https://github.com/invenia/BlueStyle)
88
# [![Aqua](https://raw.githubusercontent.com/JuliaTesting/Aqua.jl/master/badge.svg)](https://github.com/JuliaTesting/Aqua.jl)
@@ -19,6 +19,14 @@ julia> using Pkg: Pkg
1919
julia> Pkg.Registry.add(url="https://github.com/ITensor/ITensorRegistry")
2020
```
2121
=#
22+
# or:
23+
#=
24+
```julia
25+
julia> Pkg.Registry.add(url="[email protected]:ITensor/ITensorRegistry.git")
26+
```
27+
=#
28+
# if you want to use SSH credentials, which can make it so you don't have to enter your Github ursername and password when registering packages.
29+
2230
# Then, the package can be added as usual through the package manager:
2331

2432
#=

test/Project.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[deps]
2+
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
3+
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
4+
Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb"
5+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
6+
7+
[compat]
8+
Aqua = "0.8.9"
9+
SafeTestsets = "0.1"
10+
Suppressor = "0.2"
11+
Test = "1.10"
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
@eval module $(gensym())
21
using FusionTensors: FusionTensors
32
using Test: @test, @testset
43

54
@testset "FusionTensors" begin
65
# Tests go here.
76
end
8-
end

test/runtests.jl

Lines changed: 57 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,61 @@
1-
@eval module $(gensym())
2-
using Test: @testset
1+
using SafeTestsets: @safetestset
2+
using Suppressor: Suppressor
33

4-
@testset "FusionTensors.jl" begin
5-
filenames = filter(readdir(@__DIR__)) do f
6-
startswith("test_")(f) && endswith(".jl")(f)
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+
get(ENV, "GROUP", "ALL")
11+
else
12+
only(match(pat, ARGS[arg_id]).captures)
13+
end,
14+
)
15+
16+
"match files of the form `test_*.jl`, but exclude `*setup*.jl`"
17+
istestfile(fn) =
18+
endswith(fn, ".jl") && startswith(basename(fn), "test_") && !contains(fn, "setup")
19+
"match files of the form `*.jl`, but exclude `*_notest.jl` and `*setup*.jl`"
20+
isexamplefile(fn) =
21+
endswith(fn, ".jl") && !endswith(fn, "_notest.jl") && !contains(fn, "setup")
22+
23+
@time begin
24+
# tests in groups based on folder structure
25+
for testgroup in filter(isdir, readdir(@__DIR__))
26+
if GROUP == "ALL" || GROUP == uppercase(testgroup)
27+
for file in filter(istestfile, readdir(joinpath(@__DIR__, testgroup); join=true))
28+
@eval @safetestset $file begin
29+
include($file)
30+
end
31+
end
32+
end
33+
end
34+
35+
# single files in top folder
36+
for file in filter(istestfile, readdir(@__DIR__))
37+
(file == basename(@__FILE__)) && continue # exclude this file to avoid infinite recursion
38+
@eval @safetestset $file begin
39+
include($file)
40+
end
741
end
8-
@testset "Test $filename" for filename in filenames
9-
include(filename)
42+
43+
# test examples
44+
examplepath = joinpath(@__DIR__, "..", "examples")
45+
for (root, _, files) in walkdir(examplepath)
46+
contains(chopprefix(root, @__DIR__), "setup") && continue
47+
for file in filter(isexamplefile, files)
48+
filename = joinpath(root, file)
49+
@eval begin
50+
@safetestset $file begin
51+
$(Expr(
52+
:macrocall,
53+
GlobalRef(Suppressor, Symbol("@suppress")),
54+
LineNumberNode(@__LINE__, @__FILE__),
55+
:(include($filename)),
56+
))
57+
end
58+
end
59+
end
1060
end
1161
end
12-
end

test/test_aqua.jl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
@eval module $(gensym())
21
using FusionTensors: FusionTensors
32
using Aqua: Aqua
43
using Test: @testset
54

65
@testset "Code quality (Aqua.jl)" begin
76
Aqua.test_all(FusionTensors)
87
end
9-
10-
end

0 commit comments

Comments
 (0)