/
Makefile
50 lines (40 loc) · 1.38 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
# Note: This is meant for Oct2Py developer use only
.PHONY: all clean test cover release gh-pages docs
NAME:=$(shell python setup.py --name 2>/dev/null)
VERSION:=$(shell python setup.py --version 2>/dev/null)
KILL_PROC="from ${NAME} import kill_octave; kill_octave()"
all: clean
python setup.py install
install: clean
pip install -e .[docs,test]
octave --eval "pkg install -forge control"
octave --eval "pkg install -forge signal"
clean:
rm -rf build
rm -rf dist
find . -name "*.pyc" -o -name "*.py,cover"| xargs rm -f
python -c $(KILL_PROC); true
killall -9 py.test; true
test: clean
pip install -q pytest
export PYTHONWARNINGS="all"; py.test
make clean
jupyter nbconvert --to notebook --execute --ExecutePreprocessor.timeout=60 --stdout example/octavemagic_extension.ipynb > /dev/null;
cover: clean
pip install -q pytest codecov pytest-cov
py.test -l --cov-report html --cov-report=xml --cov=${NAME}
release_prep: clean
pip install -q wheel twine
git commit -a -m "Release ${VERSION}"; true
python setup.py bdist_wheel --universal
python setup.py sdist
twine check dist/*
release: release_prep
git tag v${VERSION}
git push origin --all
git push origin --tags
twine upload dist/*
docs: clean
pip install -q sphinx-rtd-theme numpydoc sphinx
export SPHINXOPTS=-W; make -C docs html
export SPHINXOPTS=-W; make -C docs linkcheck || export SPHINXOPTS=-W; make -C docs linkcheck