-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
72 lines (57 loc) · 1.94 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
VERSION_NUMBER := 0.4.0
ROOT_PACKAGE := znail
ifndef BUILD_NUMBER
BUILD_NUMBER := 0
endif
VERSION_STRING := ${VERSION_NUMBER}+${BUILD_NUMBER}
PYTHON := python3
PY_SOURCES := $(shell find $(ROOT_PACKAGE) -type f -name '*.py')
FORMAT_SOURCES := $(shell find $(ROOT_PACKAGE) -name '*.py' -not -path '*__pycache__*')
OUTPUT_DIR=output
##################################################################
##################################################################
include maketools/environment.mk
include maketools/help.mk
include maketools/doc.mk
include maketools/pypi.mk
include maketools/test.mk
include maketools/version.mk
include maketools/image.mk
test: test_local
static: static_local
.PHONY: check
check: SHELL := $(NODE_local_SHELL)
check: .SHELLFLAGS := $(NODE_local_SHELLFLAGS)
check: prepare_node_local static test
ifeq ($(filter $(COVERAGE),y),y)
@echo
@echo Combined coverage for unit and system tests
@cp .coverage-local .coverage-local-copy
COVERAGE_FILE=.coverage-all coverage combine .coverage-local-copy
COVERAGE_FILE=.coverage-all coverage report -m --rcfile=.coveragerc
ifeq ($(filter $(COVERAGE_XML_REPORT),y),y)
COVERAGE_FILE=.coverage-all coverage xml -o coverage-all.xml --rcfile=.coveragerc
endif
endif
.PHONY: package
package: check doc
run: venv
run: SHELL := $(NODE_local_SHELL)
run:
SHUTDOWN_COMMAND=echo IPTABLES_COMMAND=echo TC_COMMAND=echo HUB_CTRL_COMMAND=echo SYSTEMCTL_COMMAND=echo HOSTS_FILE=/dev/null znail -p 8080 -d
venv: prepare_node_local
.PHONY: format
format: SHELL := $(NODE_local_SHELL)
format: .SHELLFLAGS := $(NODE_local_SHELLFLAGS)
format: prepare_node_local
@yapf --style .yapf --in-place --parallel $(FORMAT_SOURCES)
@isort -j8 --multi-line 2 --apply --dont-skip '__init__.py' --line-width 100 $(FORMAT_SOURCES)
.PHONY: clean
clean: cleandoc cleanimage
rm -rf build/
rm -rf dist/
rm -f $(ROOT_PACKAGE)/version.py
rm -f .benchmark
.PHONY: cleanup
cleanup: clean cleanvenv cleannodes
rm -rf .venv