/
Makefile
122 lines (89 loc) · 3.22 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# make pep8 to check for basic Python code compliance
# make autopep8 to fix most pep8 errors
# make pylint to check Python code for enhanced compliance including naming
# and documentation
# make coverage-report to check coverage of the python scripts by the tests
PYSOURCES=$(wildcard screed/*.py)
TESTSOURCES=$(wildcard screed/tests/*.py)
SOURCES=$(PYSOURCES) setup.py
DEVPKGS=pep8==1.5.7 diff_cover autopep8 pylint coverage pytest pytest-cov sphinx
VERSION=$(shell git describe --tags --dirty | sed s/v//)
all:
./setup.py build
install-dependencies:
pip install --upgrade $(DEVPKGS) || pip2 install --upgrade $(DEVPKGS)
pip install --upgrade --requirement doc/requirements.txt
install: FORCE
./setup.py build install
develop: FORCE
./setup.py develop
dist: dist/screed-$(VERSION).tar.gz
dist/screed-$(VERSION).tar.gz: $(SOURCES)
./setup.py sdist
clean: FORCE
./setup.py clean --all || true
rm -rf build/
rm -rf coverage-debug .coverage coverage.xml
rm -rf doc/_build
rm -rf .eggs/ *.egg-info/ .cache/ __pycache__/ *.pyc */*.pyc */*/*.pyc
pep8: $(PYSOURCES) $(TESTSOURCES)
pep8 --exclude=_version.py setup.py screed/
pep8_report.txt: $(PYSOURCES) $(TESTSOURCES)
pep8 --exclude=_version.py setup.py screed/ > pep8_report.txt || true
diff_pep8_report: pep8_report.txt
diff-quality --violations=pep8 pep8_report.txt
autopep8: $(PYSOURCES) $(TESTSOURCS)
autopep8 --recursive --in-place --exclude _version.py --ignore E309 \
setup.py screed
# A command to automatically run autopep8 on appropriate files
format: autopep8
# Do nothing
pylint: FORCE
pylint --msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" \
setup.py screed || true
pylint_report.txt: ${PYSOURCES} $(TESTSOURCES)
pylint --msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" \
setup.py screed > pylint_report.txt || true
diff_pylint_report: pylint_report.txt
diff-quality --violations=pylint pylint_report.txt
.coverage: $(PYSOURCES) $(TESTSOURCES)
./setup.py test --addopts="--cov"
coverage.xml: .coverage
coverage xml --omit 'screed/tests/*'
coverage.html: htmlcov/index.html
htmlcov/index.html: .coverage
coverage html --omit 'screed/tests/*'
@echo Test coverage is now in htmlcov/index.html
coverage-report: .coverage
coverage report --omit 'screed/tests/*'
diff-cover: coverage.xml
diff-cover coverage.xml
diff-cover.html: coverage.xml
diff-cover coverage.xml --html-report diff-cover.html
tests.xml: FORCE
./setup.py test --addopts "--junitxml=$@"
doxygen: doc/doxygen/html/index.html
doc: build/sphinx/html/index.html
convert-release-notes:
for file in doc/release-notes/*.md; do \
pandoc --from=markdown --to=rst $${file} > $${file%%.md}.rst; \
done
build/sphinx/html/index.html: $(SOURCES) $(wildcard doc/*.txt) doc/conf.py all
./setup.py build_sphinx --fresh-env
@echo ''
@echo '--> docs in build/sphinx/html <--'
@echo ''
doc/doxygen/html/index.html: ${CPPSOURCES} ${PYSOURCES}
mkdir -p doc/doxygen
sed "s/\$${VERSION}/`python get_version.py`/" Doxyfile.in > \
Doxyfile
doxygen
test: FORCE
./setup.py develop
./setup.py test
sloccount.sc: ${PYSOURCES} Makefile
sloccount --duplicates --wide --details screed setup.py Makefile \
> sloccount.sc
sloccount:
sloccount screed setup.py Makefile
FORCE: