-
Notifications
You must be signed in to change notification settings - Fork 16
/
Makefile
46 lines (33 loc) · 1.31 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
# simple makefile to simplify repetetive build env management tasks under posix
# Ideas borrowed from scikit-learn's and PyMVPA Makefiles -- thanks!
PYTHON ?= python
MODULE ?= remodnav
all: clean test
clean:
$(PYTHON) setup.py clean
#rm -rf dist build bin docs/build docs/source/generated
-find . -name '*.pyc' -delete
-find . -name '__pycache__' -type d -delete
bin:
mkdir -p $@
PYTHONPATH=bin:$(PYTHONPATH) python setup.py develop --install-dir $@
test-code: bin
PATH=bin:$(PATH) PYTHONPATH=bin:$(PYTHONPATH) $(PYTHON) -m pytest -s -v $(MODULE)
test-coverage:
rm -rf coverage .coverage
PATH=bin:$(PATH) PYTHONPATH=bin:$(PYTHONPATH) $(PYTHON) -m pytest -s -v --cov=remodnav --cov-report=term-missing $(MODULE)
test: test-code
trailing-spaces:
find $(MODULE) -name "*.py" -exec perl -pi -e 's/[ \t]*$$//' {} \;
code-analysis:
flake8 $(MODULE) | grep -v __init__ | grep -v external
pylint -E -i y $(MODULE)/ # -d E1103,E0611,E1101
#update-changelog:
# @echo ".. This file is auto-converted from CHANGELOG.md (make update-changelog) -- do not edit\n\nChange log\n**********" > docs/source/changelog.rst
# pandoc -t rst CHANGELOG.md >> docs/source/changelog.rst
release-pypi: # update-changelog
# better safe than sorry
test ! -e dist
python setup.py sdist
python setup.py bdist_wheel --universal
twine upload dist/*