-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
63 lines (48 loc) · 1.63 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
ROOT_PATH=$(shell pwd)
PACKAGE_NAME=tarantism
PACKAGE_PATH=$(ROOT_PATH)/$(PACKAGE_NAME)
TESTS_PATH=$(ROOT_PATH)/tests
PIP_BIN=pip
PEP8_BIN=pep8
TEST_RUNNER=nosetests
TEST_RUNNER_ARGS=-v --nocapture
TEST_COVERAGE_REPORT_DIR=$(ROOT_PATH)/htmlcov/
TEST_COVERAGE_ARGS=--with-coverage \
--cover-package=$(PACKAGE_NAME) \
--cover-html \
--cover-html-dir=$(TEST_COVERAGE_REPORT_DIR) \
--cover-erase
all: help
help:
@echo "help - display this help."
@echo "init - install project requirements."
@echo "inittest - install tests requirements."
@echo "test - run tests"
@echo "testcoverage - run tests with code coverage report."
@echo "initdev - install development tools."
@echo "clean - clean all artifacts."
@echo "clean-build - remove build artifacts."
@echo "clean-pyc - remove Python file artifacts."
@echo "clean-tests - remove tests running artifacts."
@echo "check - check package code style via pep8 utility."
init:
$(PIP_BIN) install -r requirements.txt
inittest:
$(PIP_BIN) install -r test-requirements.txt
test: init inittest clean
$(TEST_RUNNER) $(TEST_RUNNER_ARGS) $(TESTS_PATH)
testcoverage: init inittest clean
$(TEST_RUNNER) $(TEST_RUNNER_ARGS) $(TEST_COVERAGE_ARGS) $(TESTS_PATH)
initdev:
$(PIP_BIN) install -r dev-requirements.txt
clean: clean-build clean-py
clean-build:
rm -fr build/
rm -fr dist/
rm -fr *.egg-info
clean-py:
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
check: initdev
$(PEP8_BIN) $(PACKAGE_PATH) $(TESTS_PATH)