-
Notifications
You must be signed in to change notification settings - Fork 27
/
Makefile
103 lines (80 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
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
##
# Variables
##
ENV_NAME = env
ENV_ACT = . env/bin/activate;
PIP = $(ENV_NAME)/bin/pip
PYTEST_ARGS = --doctest-modules -v -s
PYTEST_TARGET = hashfs tests
COVERAGE_ARGS = --cov-config setup.cfg --cov-report term-missing --cov
COVERAGE_TARGET = hashfs
##
# Targets
##
.PHONY: build
build: clean install
.PHONY: clean
clean: clean-env clean-files
.PHONY: clean-env
clean-env:
rm -rf $(ENV_NAME)
.PHONY: clean-files
clean-files:
rm -rf .tox
rm -rf .coverage
find . -name \*.pyc -type f -delete
find . -name \*.test.db -type f -delete
find . -depth -name __pycache__ -type d -exec rm -rf {} \;
rm -rf dist *.egg* build
.PHONY: install
install:
rm -rf $(ENV_NAME)
virtualenv --no-site-packages $(ENV_NAME)
$(PIP) install -r requirements.txt
.PHONY: test
test: flake8 pytest
.PHONY: pytest
pytest:
$(ENV_ACT) pytest $(PYTEST_ARGS) $(COVERAGE_ARGS) $(COVERAGE_TARGET) $(PYTEST_TARGET)
.PHONY: test-full
test-full: lint test-setuppy clean-files
.PHONY: test-setuppy
test-setuppy:
python setup.py test
.PHONY: lint
lint: flake8
.PHONY: flake8
flake8:
$(ENV_ACT) flake8 $(PYTEST_TARGET)
.PHONY: master
master:
git checkout master
git merge develop
git push origin develop master --tags
git checkout develop
.PHONY: release
release:
$(ENV_ACT) python setup.py sdist bdist_wheel
$(ENV_ACT) twine upload dist/*
rm -rf dist *.egg* build
.PHONY: docs
docs:
touch docs/_build
rm -r docs/_build
$(ENV_ACT) cd docs; make doctest
$(ENV_ACT) cd docs; make html
.PHONY: serve-docs
serve-docs:
cd docs/_build/html; python2 -m SimpleHTTPServer 8000
.PHONY: reload-docs
reload-docs: docs serve-docs
##
# TravisCI
##
.PHONY: travisci-install
travisci-install:
pip install -r requirements.txt
.PHONY: travisci-test
travisci-test:
flake8 $(PYTEST_TARGET)
pytest $(PYTEST_ARGS) $(COVERAGE_ARGS) $(COVERAGE_TARGET) $(PYTEST_TARGET)