-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
115 lines (88 loc) · 2.84 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
PYTHON ?= python
PYTESTS ?= pytest
CODESPELL_SKIPS ?= "doc/auto_*,*.fif,*.eve,*.gz,*.tgz,*.zip,*.mat,*.stc,*.label,*.w,*.bz2,*.annot,*.sulc,*.log,*.local-copy,*.orig_avg,*.inflated_avg,*.gii,*.pyc,*.doctree,*.pickle,*.inv,*.png,*.edf,*.touch,*.thickness,*.nofix,*.volume,*.defect_borders,*.mgh,lh.*,rh.*,COR-*,FreeSurferColorLUT.txt,*.examples,.xdebug_mris_calc,bad.segments,BadChannels,*.hist,empty_file,*.orig,*.js,*.map,*.ipynb,searchindex.dat,install_mne_c.rst,plot_*.rst,*.rst.txt,c_EULA.rst*,*.html,gdf_encodes.txt,*.svg"
CODESPELL_DIRS ?= mtsmorf/ doc/ tutorials/ examples/ tests/
# variables
name := motor-decode
image := blah/$(name)
version := 1.0.0
# recipes
all: clean inplace test
build:
docker build --rm -t $(image):$(version) .
deploy:
docker push $DOCKER_URI
clean-pyc:
find . -name "*.pyc" | xargs rm -f
find . -name "*.DS_Store" | xargs rm -f
clean-so:
find . -name "*.so" | xargs rm -f
find . -name "*.pyd" | xargs rm -f
clean-build:
rm -rf _build
rm -rf eztrack.egg-info
rm -rf CLI_EZT.egg-info
clean-ctags:
rm -f tags
clean-cache:
find . -name "__pychache__" | xargs rm -rf
rm -rf .pytest_cache
rm -rf htmlcov
rm .coverage.*
clean-logs:
rm ./eztrack/logs/*.log*
clean: clean-build clean-pyc clean-so clean-ctags clean-logs clean-cache
codespell: # running manually
@codespell -w -i 3 -q 3 -S $(CODESPELL_SKIPS) --ignore-words=ignore_words.txt $(CODESPELL_DIRS)
codespell-error: # running on travis
@echo "Running code-spell check"
@codespell -i 0 -q 7 -S $(CODESPELL_SKIPS) --ignore-words=ignore_words.txt $(CODESPELL_DIRS)
inplace:
$(PYTHON) setup.py install
pip install --upgrade --no-deps https://api.github.com/repos/mne-tools/mne-python/zipball/master
pip install --upgrade https://api.github.com/repos/mne-tools/mne-bids/zipball/master
test: inplace check-manifest
rm -f .coverage
$(PYTESTS) ./
test-doc:
$(PYTESTS) --doctest-modules --doctest-ignore-import-errors
test-coverage:
rm -rf coverage .coverage
$(PYTESTS) --cov=./ --cov-report html:coverage
trailing-spaces:
find . -name "*.py" | xargs perl -pi -e 's/[ \t]*$$//'
build-doc:
cd doc; make clean
cd doc; make html
pydocstyle:
@echo "Running pydocstyle"
@pydocstyle
pycodestyle:
@echo "Running pycodestyle"
@pycodestyle
check-manifest:
check-manifest --ignore .circleci*,doc,benchmarks,notebooks,data,tests
upload-pipy:
python setup.py sdist bdist_egg register upload
black:
@if command -v black > /dev/null; then \
echo "Running black"; \
black --check eztrack; \
black eztrack/*; \
black tests/*; \
else \
echo "black not found, please install it!"; \
exit 1; \
fi;
@echo "black passed"
mypy:
@if command -v mypy > /dev/null; then \
echo "Running mypy"; \
mypy --check eztrack; \
else \
echo "mypy not found, please install it!"; \
exit 1; \
fi;
@echo "mypy passed"
check:
@$(MAKE) -k black pydocstyle codespell-error