-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
80 lines (66 loc) · 1.54 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
# Makefile -- python with virtualenv
PACKAGE = .
ifeq ($(wildcard venv),)
$(info `venv/' does not exist .. please run `./build-aux/bootstrap' first.)
endif
## control verbosity -- `make V=1` to see verbose output, or
## -- `make V=2` for increased verbosity
ifeq ($(V),2)
PYTESTFLAGS ?= -s
VERBOSE = -vv
else ifeq ($(V),1)
VERBOSE = -v
else
VERBOSE =
endif
SHELL = /bin/sh
BINDIR = ./venv/bin
FLAKE8 = $(BINDIR)/flake8 $(VERBOSE) $(FLAKE8FLAGS)
PYTEST = $(BINDIR)/py.test $(VERBOSE) $(PYTESTFLAGS)
.PHONY: all
all:
.PHONY: check
check:
$(PYTEST)
.PHONY: cov
cov:
$(PYTEST) --cov
.PHONY: clean
clean:
$(RM) -- *.pyc
find $(PACKAGE) tests/ -name '*.pyc' -delete
.PHONY: distclean
distclean: clean
$(RM) -r .cache
$(RM) .coverage
$(RM) tags
find . -name '__pycache__' -exec $(RM) -r "{}" +
.PHONY: help
help:
@echo "Makefile targets:"
@echo
@echo " all trigger the default task (*)"
@echo " check run software tests (+)"
@echo " clean make clean"
@echo " cov check test code coverage (+)"
@echo " distclean make really clean"
@echo " help display this text"
@echo " lint run lint checks (+)"
@echo " tags create ctags tags file"
@echo
@echo " * default Make target"
@echo " ++ adding \`V=1' gives verbose output"
@echo " ++ using \`V=2' increases the verbosity"
.PHONY: lint
lint:
$(FLAKE8)
.PHONY: tags
tags:
ctags \
--exclude=venv \
--exclude=__pycache__ \
--exclude=.cache \
--exclude=_attic \
--python-kinds=-i \
--recurse
# -fin-