-
Notifications
You must be signed in to change notification settings - Fork 148
/
Makefile
31 lines (23 loc) · 902 Bytes
/
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
PY_VERSION := $(wordlist 2,4,$(subst ., ,$(shell python --version 2>&1)))
PY_MAJOR := $(word 1,${PY_VERSION})
PY_MINOR := $(word 2,${PY_VERSION})
PY_GTE_35 = $(shell echo $(PY_MAJOR).$(PY_MINOR)\>=3.5 | bc)
.PHONY: all flake8 clean test check
all:
@echo 'flake8 check flake8 compliance'
@echo 'clean cleanup the source tree'
@echo 'test run the unit tests'
@echo 'check make sure you are ready to commit'
flake8:
@flake8 --ignore=E741,W503,W504 backoff tests
mypy:
@mypy --show-error-codes backoff tests
clean:
@find . -name "*.pyc" -delete
@find . -name "__pycache__" -delete
@rm -rf build dist .coverage MANIFEST
test: clean
@PYTHONPATH=. py.test --cov-report term-missing --cov backoff tests
check: flake8 mypy test
@coverage report | grep ^TOTAL | grep 100% >/dev/null || \
{ echo 'Unit tests coverage is incomplete.'; exit 1; }