Repository navigation
Expand file tree
/
Copy pathwscript
More file actions
96 lines (82 loc) · 2.47 KB
/
Copy pathwscript
File metadata and controls
96 lines (82 loc) · 2.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/usr/bin/env python
from waflib.extras.test_base import summary
import os
from waflib.extras.symwaf2ic import get_toplevel_path
def depends(dep):
dep("code-format")
dep("nir")
dep("hxtorch")
def options(opt):
opt.load("compiler_cxx")
opt.load("test_base")
opt.load("python")
opt.load("pytest")
opt.load("pylint")
opt.load("pycodestyle")
opt.load("doxygen")
def configure(cfg):
cfg.load("compiler_cxx")
cfg.load("test_base")
cfg.load("python")
cfg.check_python_version()
cfg.check_python_headers()
cfg.load("pytest")
cfg.load("pylint")
cfg.load("pycodestyle")
cfg.load("doxygen")
def build(bld):
bld.env.BBS_HARDWARE_AVAILABLE = "SLURM_HWDB_YAML" in os.environ
bld(
target="jaxsnn",
features="py use",
use=["hxtorch", "_hxtorch_core", "nir"],
relative_trick=True,
source=bld.path.ant_glob("src/pyjaxsnn/**/*.py"),
install_from="src/pyjaxsnn",
)
bld(
target="jaxsnn_linting",
features="use pylint pycodestyle",
use=["hxtorch", "_hxtorch_core", "nir"],
tests=bld.path.ant_glob("src/pyjaxsnn/**/*.py"),
pylint_config=os.path.join(
get_toplevel_path(), "code-format", "pylintrc"),
pycodestyle_config=os.path.join(
get_toplevel_path(), "code-format", "pycodestyle"),
test_timeout=60,
)
bld(
target="jaxsnn_hwtests",
tests=bld.path.ant_glob("tests/hw/**/*.py"),
features="use pytest",
use=["jaxsnn"],
install_path="${PREFIX}/bin/tests/jaxsnn/hw",
test_timeout=2500,
skip_run=not bld.env.BBS_HARDWARE_AVAILABLE
)
bld(
target="jaxsnn_swtests",
tests=bld.path.ant_glob("tests/sw/**/*.py"),
features="use pytest",
use=["jaxsnn"],
install_path="${PREFIX}/bin/tests/jaxsnn/sw",
test_timeout=300,
)
bld(
target="doxygen_pyjaxsnn",
features="doxygen",
doxyfile=bld.root.make_node(
os.path.join(get_toplevel_path(), "code-format", "doxyfile")
),
doxy_inputs="src/pyjaxsnn",
install_path="doc/pyjaxsnn",
pars={
"PROJECT_NAME": '"pyjaxsnn"',
"OUTPUT_DIRECTORY": os.path.join(
get_toplevel_path(), "build", "pyjaxsnn", "doc"
),
"PYTHON_DOCSTRING": "NO",
},
)
# Create test summary (to stdout and XML file)
bld.add_post_fun(summary)