-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
57 lines (40 loc) · 1.46 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
# Makefile for Mattis-Bardeen module
#
# Makefile examples that I drew from:
# https://github.com/pjz/mhi/blob/master/Makefile
# http://krzysztofzuraw.com/blog/2016/makefiles-in-python-projects.html
#
CODE_PATH=./mattisbardeen.py
TEST_PATH=./test_mattisbardeen.py
all: test clean
# Run tests (with Py.Test) ---------------------------------------------------
test:
py.test $(TEST_PATH) --verbose --doctest-modules --color=yes
cov:
py.test $(TEST_PATH) --verbose --doctest-modules --color=yes --cov=$(CODE_PATH) --cov-report=term-missing
cov-report:
py.test $(TEST_PATH) --verbose --doctest-modules --color=yes --cov=$(CODE_PATH) --cov-report=html
open htmlcov/index.html
clean-test:
find . -name 'htmlcov' -exec rm -rf {} +
# Build ----------------------------------------------------------------------
build:
python setup.py sdist
upload:
twine upload dist/*
clean-build:
rm -rf build/
rm -rf dist/
rm -rf QMix.egg-info/
rm MANIFEST
# Clean ----------------------------------------------------------------------
clean-bytecode:
find . -name '*.pyc' -exec rm -f {} +
clean-hidden:
find . -name '.coverage' -exec rm -rf {} +
find . -name '.cache' -exec rm -rf {} +
find . -name '__pycache__' -exec rm -rf {} +
find . -name '__pycache__\ \(1\)' -exec rm -rf {} +
clean: clean-bytecode clean-hidden clean-test clean-build
# Misc -----------------------------------------------------------------------
.PHONY: all test clean-test clean clean-bytecode clean-hidden