-
Notifications
You must be signed in to change notification settings - Fork 16
/
Makefile
65 lines (55 loc) · 2.41 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
.PHONY: clean install test testdebug lint docs discodop py2
all: discodop
clean:
rm -rf build/
find discodop -name '*.c' -delete
find discodop -name '*.cpp' -delete
find discodop -name '*.so' -delete
find discodop -name '*.pyc' -delete
find discodop -name '*.html' -delete
rm -rf */__pycache__
cd docs && make clean
discodop:
python3 setup.py install --user
cp build/lib.*/discodop/*.so discodop/
docs:
mkdir -p ~/.local/man/man1
cd docs && make man && cp _build/man/* ~/.local/man/man1/
cd docs && make html
install: discodop docs
debug:
# NB: debug build requires all external modules to be compiled
# with debug symbols as well (e.g., install python-numpy-dbg package)
python3-dbg setup.py install --user --debug
cp build/lib.*/discodop/*.so discodop/
debugvalgrind: debug
valgrind --tool=memcheck --leak-check=full --num-callers=30 \
--suppressions=valgrind-python.supp --show-leak-kinds=definite \
python3-dbg `which py.test` --doctest-modules discodop/ tests/unittests.py
valgrind --tool=memcheck --leak-check=full --num-callers=30 \
--suppressions=valgrind-python.supp --show-leak-kinds=definite \
python3-dbg -bb -tt tests.py
valgrind: discodop
valgrind --tool=memcheck --leak-check=full --num-callers=30 \
--suppressions=valgrind-python.supp --show-leak-kinds=definite \
python3 tests.py
test: discodop
python3 `which py.test` --doctest-modules discodop/ tests/unittests.py \
&& python3 -bb -tt tests.py \
&& cd tests/ && sh run.sh
# pylint: R=refactor, I=informational, e.g. "I0011: Locally disabling %s"
# pycodestyle: W503 line break before binary operator; E402 module level import not at top of file
lint: discodop
# Any files with more than 999 lines?
cd discodop; wc -l *.py *.pyx *.pxi *.pxd | egrep '[0-9]{4,}' | sort -n
# Docstrings without single line summaries?
cd discodop; egrep -n '""".*[^].\"\\)]$$' *.pxd *.pyx *.py || echo 'none!'
pycodestyle --ignore=E1,W1,E402,E501,W503 \
discodop/*.py web/*.py tests/*.py \
&& pycodestyle --ignore=F,W1,W503,E1,E211,E225,E226,E227,E402,E901 \
discodop/*.pyx discodop/*.pxi discodop/*.pxd \
&& python3 `which pylint` --indent-string='\t' --max-line-length=80 \
--disable=I,R,bad-continuation,invalid-name,star-args,wrong-import-position,wrong-import-order,ungrouped-imports,import-outside-toplevel,superfluous-parens \
--enable=cyclic-import \
--extension-pkg-whitelist=discodop,faulthandler,roaringbitmap \
discodop/*.py web/*.py tests/*.py