forked from tartiflette/tartiflette
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
66 lines (53 loc) · 1.89 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
SET_ALPHA_VERSION = 0
PKG_VERSION := $(shell cat setup.py | grep "_VERSION =" | egrep -o "([0-9]+\\.[0-9]+\\.[0-9]+)")
ifneq ($(and $(TRAVIS_BRANCH),$(TRAVIS_BUILD_NUMBER)),)
ifneq ($(TRAVIS_BRANCH), master)
PKG_VERSION := $(shell echo | awk -v pkg_version="$(PKG_VERSION)" -v travis_build_number="$(TRAVIS_BUILD_NUMBER)" '{print pkg_version "a" travis_build_number}')
SET_ALPHA_VERSION = 1
endif
endif
.PHONY: init
init:
git submodule init
git submodule update
.PHONY: format-import
format-import:
isort -rc tartiflette/. tests/.
.PHONY: format
format: format-import
black -l 79 --py36 tartiflette tests setup.py
.PHONY: check-import
check-import:
isort --check-only -rc tartiflette/. tests/.
.PHONY: check-format
check-format:
black -l 79 --py36 --check tartiflette tests setup.py
.PHONY: style
style: check-format check-import
pylint tartiflette --rcfile=pylintrc
.PHONY: complexity
complexity:
xenon --max-absolute B --max-modules B --max-average A tartiflette
.PHONY: test-integration
test-integration: clean
true
.PHONY: test-unit
test-unit: clean
mkdir -p reports
py.test -s tests/unit --junitxml=reports/report_unit_tests.xml --cov . --cov-config .coveragerc --cov-report term-missing --cov-report xml:reports/coverage_func.xml $(EXTRA_ARGS)
.PHONY: test-functional
test-functional: clean
mkdir -p reports
py.test -s tests/functional --junitxml=reports/report_func_tests.xml --cov . --cov-config .coveragerc --cov-report term-missing --cov-report xml:reports/coverage_unit.xml $(EXTRA_ARGS)
.PHONY: test
test: test-integration test-unit test-functional
.PHONY: clean
clean:
find . -name '*.pyc' -exec rm -fv {} +
find . -name '*.pyo' -exec rm -fv {} +
find . -name '__pycache__' -exec rm -frv {} +
.PHONY: set-version
set-version:
ifneq ($(SET_ALPHA_VERSION), 0)
bash -c "sed -i \"s@_VERSION[ ]*=[ ]*[\\\"\'][0-9]\+\\.[0-9]\+\\.[0-9]\+[\\\"\'].*@_VERSION = \\\"$(PKG_VERSION)\\\"@\" setup.py"
endif