-
Notifications
You must be signed in to change notification settings - Fork 316
/
Makefile
51 lines (39 loc) · 1.1 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
.PHONY: all clean clean-deps lint test deps coverage
.DEFAULT_GOAL := all
# Python-specific stuff
TOX := $(shell command -v tox 2> /dev/null)
PIP := $(shell command -v pip3 2> /dev/null)
FLAKE8 := $(shell command -v flake8 2> /dev/null)
.ensure-tox: .ensure-pip
ifndef TOX
rm -f .ensure-tox
$(error "tox is not installed. Install with `pip install [--user] tox`.")
endif
touch .ensure-tox
.ensure-pip:
ifndef PIP
rm -f .ensure-pip
$(error "pip is not installed. Install with `python -m [--user] ensurepip`.")
endif
touch .ensure-pip
.ensure-flake8: .ensure-pip
ifndef FLAKE8
rm -f .ensure-flake8
$(error "flake8 is not installed. Install with `pip install [--user] flake8`.")
endif
touch .ensure-pip
all: test lint coverage
deps: setup.py .ensure-tox tox.ini
$(VIRTUALENV_BIN)/flake8 $(VIRTUALENV_BIN)/py.test: $(DEPS_UPTODATE)
lint: .ensure-flake8
$(FLAKE8) grafanalib
test: .ensure-tox
$(TOX) --skip-missing-interpreters
coverage:
$(TOX) -e coverage
clean:
rm -rf grafanalib.egg-info
rm -f .ensure-pip .ensure-tox .ensure-flake8
find . -name '*.pyc' | xargs rm
clean-deps:
rm -rf $(VIRTUALENV_DIR)