-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
71 lines (59 loc) · 1.43 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
PACKAGE_NAME?=counsyl_pyads
TEST_OUTPUT_DIR?=test-output
TEST_OUTPUT_XML?=nosetests.xml
COVERAGE_DIR?=htmlcov
COVERAGE_DATA?=.coverage
VENV_DIR?=.venv
ifneq ($(VIRTUAL_ENV),)
VENV_DIR=$(VIRTUAL_ENV)
endif
VENV_ACTIVATE=$(VENV_DIR)/bin/activate
WITH_VENV=. $(VENV_ACTIVATE);
$(VENV_ACTIVATE): requirements.txt requirements-dev.txt
test -f $@ || virtualenv --python=python2.7 $(VENV_DIR)
$(WITH_VENV) pip install --no-deps -r requirements.txt
$(WITH_VENV) pip install --no-deps -r requirements-dev.txt
touch $@
default:
python setup.py check build
.PHONY: venv
venv: $(VENV_ACTIVATE)
.PHONY: setup
setup: venv
.PHONY: develop
develop: venv
$(WITH_VENV) python setup.py develop
.PHONY: clean
clean:
python setup.py clean
rm -rf build/
rm -rf dist/
rm -rf *.egg*/
rm -rf __pycache__/
rm -f MANIFEST
rm -rf $(TEST_OUTPUT_DIR)
rm -rf $(COVERAGE_DIR)
rm -f $(COVERAGE_DATA)
find $(PACKAGE_NAME) -type f -name '*.pyc' -delete
.PHONY: teardown
teardown:
rm -rf $(VENV_DIR)/
.PHONY: lint
lint: venv
$(WITH_VENV) flake8 -v $(PACKAGE_NAME)/ $(LINT_ARGS)
.PHONY: quality
quality: venv
$(WITH_VENV) radon cc -s $(PACKAGE_NAME)/
$(WITH_VENV) radon mi $(PACKAGE_NAME)/
.PHONY: test
test: develop
$(WITH_VENV) py.test -v \
--doctest-modules \
--ignore=setup.py \
--ignore=$(VENV_DIR) \
--junit-xml=$(TEST_OUTPUT_DIR)/$(TEST_OUTPUT_XML) \
--cov=${PACKAGE_NAME} \
--cov-report=html $(TEST_ARGS)
.PHONY: sdist
sdist:
python setup.py sdist