-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
130 lines (89 loc) · 2.47 KB
/
Makefile
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
.PHONY : all clean clean-python compile coverage generate idris lint machines profile special test test-all type
all : machines idris lint test tools
clean-python :
rm -rf __pycache__ **/__pycache__ .mypy_cache .mutmut-cache .ruff_cache .coverage* html* build/ *.so **/*.so classes.png packages.png
clean : clean-python clean-rust
$(MAKE) -C machines clean
$(MAKE) -C idris clean
refresh : clean-python rust
quick-check : refresh test-rust lint coverage
## Odd langs ###########################
machines :
$(MAKE) -C machines
idris :
$(MAKE) -C idris
## Rust ################################
RUST_STUFF = tm/rust_stuff.so
rust :
cargo build --release
cp target/release/librust_stuff.so $(RUST_STUFF)
dev :
cargo build
cp target/debug/librust_stuff.so $(RUST_STUFF)
CARGO_VERSION = cargo --version
clippy :
$(CARGO_VERSION)
cargo clippy --all-targets
CARGO_TEST = cargo test
test-rust :
$(CARGO_VERSION)
$(CARGO_TEST)
test-rust-slow :
$(CARGO_VERSION)
$(CARGO_TEST) -- --nocapture --ignored
clean-rust :
cargo clean
## Python ##############################
PYTHON = python3
MODULES = tm tools test perf *.py
RUFF = $(PYTHON) -m ruff
PYLINT = $(PYTHON) -m pylint
lint : clippy rust
$(RUFF) --version
$(RUFF) check $(MODULES)
$(MAKE) type
$(PYLINT) --version
$(PYLINT) --enable-all-extensions $(MODULES) --ignore-patterns=.*.pyi
MYPY = $(PYTHON) -m mypy
type :
$(MYPY) --version
$(MYPY) $(MODULES)
MYPYC = $(PYTHON) -m mypyc
TEST_COMPILE = test/utils.py test/lin_rec.py
compile : rust
$(MYPYC) --version
$(MYPYC) tm tools $(TEST_COMPILE) --exclude rust_stuff
TUR = test.test_turing
PROG = test.test_program
GRAPH = test.test_graph
COV = test.test_coverage
CG = test.test_code
TP = test.test_tape
NUM = test.test_num
RUL = test.test_rules
HOLD = test.test_holdouts
SHORT_TESTS = $(PROG) $(GRAPH) $(CG) $(RUL) $(TP) $(COV) $(NUM) $(HOLD)
PYTEST = $(PYTHON) -m unittest
test : test-rust
$(PYTEST) discover -v
test-all : test-rust compile
RUN_SLOW=1 $(MAKE) test
tree : compile
RUN_SLOW=1 $(PYTEST) test.test_tree
$(MAKE) refresh
COVERAGE = $(PYTHON) -m coverage
coverage : rust
$(COVERAGE) --version
$(COVERAGE) run -m unittest -v $(SHORT_TESTS)
$(COVERAGE) combine --quiet
$(COVERAGE) html
diagrams :
pyreverse --only-classnames --no-standalone --colorized -o png tm tools test perf
# PYTHONPATH=$PYTHONPATH:tm make special target=tm/tape.py
special :
specialist --target $(target) -m unittest $(TUR)
mutmut :
-mutmut run
mutmut html
profile :
$(MAKE) -C perf