forked from CamDavidsonPilon/tdigest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
71 lines (58 loc) · 1.81 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
PROJ=tdigest
PYTHON=python
TEST_TIMEOUT=600
default:
@echo "Try one of:"
@echo " env - build a dev env in env/"
@echo " test - run all the tests"
@echo " test1 - run tests until one fails"
@echo " package - build a .whl for potential deployment"
@echo " release - build the .whl on the current machine with a new version number, tag and push the source"
@echo " deploy - (requires sudo) build and install the .whl on the current machine"
@echo " clean - nuke all generated output"
env:
virtualenv --python=`which $(PYTHON)` env
@if [ -d vendor ]; then \
./env/bin/pip install -e .[tests] --find-links vendor/ ;\
else \
./env/bin/pip install -e .[tests] ;\
fi
test: env
./env/bin/py.test tests --timeout=$(TEST_TIMEOUT)
test1: env
./env/bin/py.test -x --ff tests --timeout=$(TEST_TIMEOUT)
shippabletest: env
mkdir -p shippable/testresults shippable/codecoverage
./env/bin/py.test \
--cov-report xml \
--cov=$(PROJ) \
--junitxml=shippable/testresults/pytest.xml tests
mv coverage.xml shippable/codecoverage/
travistest: env
./env/bin/py.test -v \
--cov-report xml \
--cov-report term \
--cov-report html \
--cov=$(PROJ) \
--junitxml=testresults.xml tests
clean:
rm -rf env build dist *.egg *.egg-info
package:
$(PYTHON) setup.py bdist_wheel
deploy: package
sudo pip install --upgrade `ls ./dist/*.whl | tail -1`
release:
@if git tag | grep -q v`$(PYTHON) setup.py -V` ; then\
echo "Already released this version.";\
echo "Update the version number and try again.";\
exit 1;\
fi
@if [ `git status --short | wc -l` != 0 ]; then\
echo "Uncommited code. Aborting." ;\
exit 1;\
fi
$(PYTHON) setup.py bdist_wheel
git tag v`$(PYTHON) setup.py -V`
git push
git push --tags
.PHONY: default package deploy release clean