-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
56 lines (44 loc) · 1.26 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
NAME = $(notdir $(CURDIR))
PACKAGE_NAME = $(subst -,_,$(NAME))
.PHONY: all
all: build
.PHONY: test-dependencies
test-dependencies: virtualenv
. virtualenv/bin/activate && pip install --requirement requirements.txt || exit $$?; \
.PHONY: test
test: test-dependencies
. virtualenv/bin/activate && \
make METHOD=git python-pep8 && \
PYTHONPATH=. coverage run setup.py test && \
coverage report --include='$(PACKAGE_NAME)/*' --fail-under=100
.PHONY: test-clean
test-clean:
# Run after `make clean`
test -z "$$($(GIT) clean --dry-run -dx)"
.PHONY: build
build: test virtualenv
mkdir -p $@
. virtualenv/bin/activate && \
python setup.py build
.PHONY: install
install: virtualenv
$(SYSTEM_PYTHON) setup.py install $(INSTALL_OPTIONS)
.PHONY: clean
clean: clean-build clean-test
.PHONY: clean-build
clean-build: clean-build-third-party clean-build-local
.PHONY: clean-build-third-party
clean-build-third-party:
-$(RM) -r build
.PHONY: clean-build-local
clean-build-local:
-$(RM) -r $(PACKAGE_NAME).egg-info
-$(FIND) . -type d -name '__pycache__' -exec $(RM) -r {} +
-$(FIND) . -type f -name '*.pyc' -delete
.PHONY: clean-test
clean-test:
-$(RM) .coverage
-$(RM) virtualenv
include configuration.mk
include make-includes/python.mk
include make-includes/variables.mk