-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
69 lines (48 loc) · 1.5 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
# Tools
PYTHON ?= python3
FLAKE8 ?= flake8
PYTEST ?= py.test-3
CHGLOG ?= git-chglog
ISORT ?= isort
# Variables
PYTHONPATH ?= .
ARGS ?=
PYTEST_OPTIONS+=-s
PYTEST_COVERAGE_OPTIONS+=--cov-report=term-missing
ISORT_OPTIONS+=--recursive
ISORT_CHECK_OPTIONS+=--check-only --diff
# Rules
.PHONY: all
all:
.PHONY: lint
lint:
$(FLAKE8) -v --format=pylint ./grapi
.PHONY: test-isort
test-isort:
${ISORT} ${ISORT_OPTIONS} ${ISORT_CHECK_OPTIONS} .
.PHONY: isort
isort:
${ISORT} ${ISORT_OPTIONS} .
.PHONY: test
test:
PYTHONPATH=${PYTHONPATH} ${PYTEST} ${PYTEST_OPTIONS} test/unit
.PHONY: test-backend-kopano
test-backend-kopano:
PYTHONPATH=${PYTHONPATH} ${PYTEST} ${PYTEST_OPTIONS} ${ARGS} test/integration/backend.kopano
.PHONY: test-backend-kopano-cov
test-backend-kopano-cov: ARGS = --cov=grapi.backend.kopano --cov-report=html:test/coverage/integration/backend.kopano
test-backend-kopano-cov: test-backend-kopano
.PHONY: changelog
changelog: ; $(info updating changelog ...)
$(CHGLOG) --output CHANGELOG.md $(ARGS) v0.1.0..
# CI
.PHONY: test-backend-kopano-ci
test-backend-kopano-ci: ARGS = --cov=grapi.backend.kopano --junit-xml=test/coverage/integration/backend.kopano/integration.xml --cov-report=html:test/coverage/integration/backend.kopano -p no:cacheprovider
test-backend-kopano-ci: test-backend-kopano
# Dev helpers
.PHONY: start-mfr
start-mfr:
PYTHONPATH=$(PYTHONPATH) $(PYTHON) grapi/mfr $(ARGS)
.PHONY: start-devrunner
start-devrunner:
PYTHONPATH=$(PYTHONPATH) $(PYTHON) scripts/devrunner.py $(ARGS)