/
Makefile
48 lines (31 loc) · 1.18 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
PACKAGE=django_factory_boy
# Use current python binary instead of system default.
COVERAGE = python $(shell which coverage)
# Dependencies
DJANGO ?= 1.8
NEXT_DJANGO = $(shell python -c "v='$(DJANGO)'; parts=v.split('.'); parts[-1]=str(int(parts[-1])+1); print('.'.join(parts))")
REQ_FILE = auto_dev_requirements_django$(DJANGO).txt
all: default
default:
install-deps: $(REQ_FILE)
pip install --upgrade pip setuptools
pip install --upgrade -r $<
pip freeze
$(REQ_FILE): dev_requirements.txt requirements.txt
grep --no-filename "^[^#-]" $^ | egrep -v "^Django" > $@
echo "Django>=$(DJANGO),<$(NEXT_DJANGO)" >> $@
clean:
find . -type f -name '*.pyc' -delete
find . -type f -path '*/__pycache__/*' -delete
find . -type d -empty -delete
@rm -f auto_dev_requirements_*
test:
python -W default setup.py test
pylint:
pylint --rcfile=.pylintrc --report=no $(PACKAGE)/
coverage: install-deps
$(COVERAGE) erase
$(COVERAGE) run "--include=$(PACKAGE)/*.py,$(TESTS_DIR)/*.py" --branch setup.py test
$(COVERAGE) report "--include=$(PACKAGE)/*.py,$(TESTS_DIR)/*.py"
$(COVERAGE) html "--include=$(PACKAGE)/*.py,$(TESTS_DIR)/*.py"
.PHONY: all default clean coverage install-deps pylint test