-
Notifications
You must be signed in to change notification settings - Fork 186
/
Makefile
155 lines (125 loc) · 4.29 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# BENCHMARKSETTINGS = --ignore=venv -vv --benchmark-autosave --benchmark-storage=file://./benchmark-results --benchmark-disable-gc --benchmark-histogram=./benchmark-results/benchmark_$(shell date +%Y%m%d_%H%M%S) --benchmark-only
BENCHMARKSETTINGS = --ignore=venv -vv --benchmark-autosave --benchmark-disable-gc --benchmark-histogram=./benchmark-results/benchmark_$(shell date +%Y%m%d_%H%M%S) --benchmark-only
.PHONY: default
default:
@echo "Possible actions:"
@echo "- analyze_build"
@echo "- benchmark"
@echo "- build"
@echo "- clean"
@echo "- test"
@echo "- testall"
.PHONY: runtest
runtest:
export PYTHONPATH=.;python3 tests/test_bugs.py
.PHONY: test
test:
export PYTHONPATH=.;py.test --ignore=venv --benchmark-skip -vv
.PHONY: pypy-test
pypy-test:
export PYTHONPATH=.;pypy3 -m py.test --ignore=venv --benchmark-skip -vv -c pytest-nolibs.ini
.PHONY: test-windows
test-windows:
pytest --ignore=venv --benchmark-skip -vv -c pytest-nolibs.ini
.PHONY: test-nolibs
test-nolibs:
export PYTHONPATH=.;pytest --ignore=venv --benchmark-skip -vv -c pytest-nolibs.ini
.PHONY: testall
testall:
export PYTHONPATH=.;py.test --ignore=venv -vv
.PHONY: benchmark
benchmark:
export PYTHONPATH=.;py.test ${BENCHMARKSETTINGS}
.PHONY: benchmark-parallelc
benchmark-parallelc:
export PYTHONPATH=.;py.test -k 'matrix1 or distance1' ${BENCHMARKSETTINGS}
.PHONY: benchmark-distancec
benchmark-distancec:
export PYTHONPATH=.;py.test -k 'distance1' ${BENCHMARKSETTINGS}
.PHONY: benchmark-matrixc
benchmark-matrixc:
export PYTHONPATH=.;py.test -k 'matrix1 and _c' ${BENCHMARKSETTINGS}
.PHONY: benchmark-clustering
benchmark-clustering:
export PYTHONPATH=.;py.test -k cluster ${BENCHMARKSETTINGS}
.PHONY: benchmark-subseqsearch
benchmark-subseqsearch:
export PYTHONPATH=.;py.test -k test_dtw_subseqsearch_eeg_lb ${BENCHMARKSETTINGS}
.PHONY: clean
clean:
python3 setup.py clean
rm -f dtaidistance/dtw_c.c
rm -f dtaidistance/dtw_c.html
rm -f dtaidistance/dtw_c.so
rm -f dtaidistance/dtw_c.*.so
rm -f dtaidistance/dtw_cc.c
rm -f dtaidistance/dtw_cc.html
rm -f dtaidistance/dtw_cc.*.so
rm -f dtaidistance/dtw_cc_*.c
rm -f dtaidistance/dtw_cc_*.html
rm -f dtaidistance/dtw_cc_*.*.so
rm -f dtaidistance/ed_cc.c
rm -f dtaidistance/ed_cc.html
rm -f dtaidistance/ed_cc.*.so
rm -f dtaidistance/util_*_cc.c
rm -f dtaidistance/util_*_cc.html
rm -f dtaidistance/util_*_cc.*.so
rm -f dtaidistance/*.pyc
rm -rf dtaidistance/__pycache__
.PHONY: use-venv
use-venv:
$(eval $@_TMP := $(shell python3 -c 'import sys; print(sys.prefix)'))
@#@echo $($@_TMP)
@if [ -f "use_venv.txt" ]; then grep '$($@_TMP)' use_venv.txt || (echo "venv does not appear in use_venv.txt: $($@_TMP)"; exit 1) ;fi
.PHONY: build
build: use-venv
python3 setup.py build_ext --inplace
.PHONY: pypy-build
pypy-build:
pypy3 setup.py build_ext --inplace
.PHONY: analyze_build
analyze_build:
cd dtaidistance;cython dtw_c.pyx -a
open dtaidistance/dtw_c.html
.PHONY: dist
dist:
rm -rf dist/*
python3 setup.py sdist
.PHONY: prepare_dist
prepare_dist:
rm -rf dist/*
python3 setup.py sdist bdist_wheel
.PHONY: add_to_dist
add_to_dist: build test
$(eval $@_TMP := $(shell python3 -c 'import sys; print(sys.prefix)'))
@echo "==============================================================="
@echo "Using virtual env: $(@_TMP)"
@echo "==============================================================="
python3 setup.py sdist bdist_wheel
.PHONY: prepare_tag
prepare_tag:
@echo "Check whether repo is clean"
git diff-index --quiet HEAD
@echo "Check correct branch"
if [[ "$$(git rev-parse --abbrev-ref HEAD)" != "deploy" ]]; then echo 'Not deploy branch'; exit 1; fi
@echo "Add tag"
git tag "v$$(python3 setup.py --version)"
git push --tags
.PHONY: deploy
deploy: prepare_dist prepare_tag
@echo "Check whether repo is clean"
git diff-index --quiet HEAD
@echo "Manual action: Push to deploy Github branch to deploy"
#@echo "Start uploading"
#twine upload --repository dtaidistance dist/*
.PHONY: upload_from_local_machine
upload_from_local_machine:
@echo "Did you run 'make add_to_dist' first?"
@echo "Uploading the following distributions:"
@ls dist/
@echo "Are you sure? [y/n] " && read ans && ( [ $${ans:-N} = y ] || ( echo "Aborted" && exit 1 ) )
@echo "Start uploading"
twine upload --repository dtaidistance dist/*
.PHONY: docs
docs:
export PYTHONPATH=..; cd docs; make html