forked from kpn/py-etcd-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
63 lines (44 loc) · 1.14 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
# This Makefile requires the following commands to be available:
# * python2.7
# * docker
# * docker-compose
DEPS:=requirements.txt
DOCKER_COMPOSE=$(shell which docker-compose)
PIP:="venv/bin/pip"
CMD_FROM_VENV:=". venv/bin/activate; which"
TOX=$(shell "$(CMD_FROM_VENV)" "tox")
PYTHON=$(shell "$(CMD_FROM_VENV)" "python")
TOX_PY_LIST="$(shell $(TOX) -l | grep ^py | xargs | sed -e 's/ /,/g')"
.PHONY: clean docsclean pyclean test lint isort docs docker setup.py
tox: venv setup.py
$(TOX)
pyclean:
@find . -name *.pyc -delete
@rm -rf *.egg-info build
@rm -rf coverage.xml .coverage
docsclean:
@rm -fr docs/_build/
clean: pyclean docsclean
@rm -rf venv
venv:
@virtualenv -p python2.7 venv
@$(PIP) install -U "pip>=7.0" -q
@$(PIP) install -r $(DEPS)
test: clean tox
test/%: venv pyclean
$(TOX) -e $(TOX_PY_LIST) -- $*
lint: venv
@$(TOX) -e lint
@$(TOX) -e isort-check
isort: venv
@$(TOX) -e isort-fix
docs: venv
@$(TOX) -e docs
docker:
$(DOCKER_COMPOSE) run --rm app bash
docker/%:
$(DOCKER_COMPOSE) run --rm app make $*
setup.py: venv
$(PYTHON) setup_gen.py
@$(PYTHON) setup.py check --restructuredtext
build: clean venv tox setup.py