Debian Codegraph @

Makefile

raw
1 PROJ=billiard
2 PYTHON=python
3 GIT=git
4 TOX=tox
5 NOSETESTS=nosetests
6 ICONV=iconv
7 FLAKE8=flake8
8 FLAKEPLUS=flakeplus
9 SPHINX2RST=sphinx2rst
10
11 SPHINX_DIR=docs/
12 SPHINX_BUILDDIR="${SPHINX_DIR}/_build"
13 README=README.rst
14 README_SRC="docs/templates/readme.txt"
15 CONTRIBUTING=CONTRIBUTING.rst
16 CONTRIBUTING_SRC="docs/contributing.rst"
17 SPHINX_HTMLDIR="${SPHINX_BUILDDIR}/html"
18 DOCUMENTATION=Documentation
19 FLAKEPLUSTARGET=2.7
20
21 all: help
22
23 help:
24 @echo "docs - Build documentation."
25 @echo "test-all - Run tests for all supported python versions."
26 @echo "distcheck ---------- - Check distribution for problems."
27 @echo " test - Run unittests using current python."
28 @echo " lint ------------ - Check codebase for problems."
29 @echo " apicheck - Check API reference coverage."
30 @echo " configcheck - Check configuration reference coverage."
31 @echo " readmecheck - Check README.rst encoding."
32 @echo " contribcheck - Check CONTRIBUTING.rst encoding"
33 @echo " flakes -------- - Check code for syntax and style errors."
34 @echo " flakecheck - Run flake8 on the source code."
35 @echo " flakepluscheck - Run flakeplus on the source code."
36 @echo "readme - Regenerate README.rst file."
37 @echo "contrib - Regenerate CONTRIBUTING.rst file"
38 @echo "clean-dist --------- - Clean all distribution build artifacts."
39 @echo " clean-git-force - Remove all uncommitted files."
40 @echo " clean ------------ - Non-destructive clean"
41 @echo " clean-pyc - Remove .pyc/__pycache__ files"
42 @echo " clean-docs - Remove documentation build artifacts."
43 @echo " clean-build - Remove setup artifacts."
44
45 clean: clean-docs clean-pyc clean-build
46
47 clean-dist: clean clean-git-force
48
49 Documentation:
50 (cd "$(SPHINX_DIR)"; $(MAKE) html)
51 mv "$(SPHINX_HTMLDIR)" $(DOCUMENTATION)
52
53 docs: Documentation
54
55 clean-docs:
56 -rm -rf "$(SPHINX_BUILDDIR)"
57
58 lint: flakecheck apicheck configcheck readmecheck
59
60 apicheck:
61 (cd "$(SPHINX_DIR)"; $(MAKE) apicheck)
62
63 configcheck:
64 (cd "$(SPHINX_DIR)"; $(MAKE) configcheck)
65
66 flakecheck:
67 $(FLAKE8) "$(PROJ)"
68
69 flakediag:
70 -$(MAKE) flakecheck
71
72 flakepluscheck:
73 $(FLAKEPLUS) --$(FLAKEPLUSTARGET) "$(PROJ)"
74
75 flakeplusdiag:
76 -$(MAKE) flakepluscheck
77
78 flakes: flakediag flakeplusdiag
79
80 clean-readme:
81 -rm -f $(README)
82
83 readmecheck:
84 $(ICONV) -f ascii -t ascii $(README) >/dev/null
85
86 $(README):
87 $(SPHINX2RST) "$(README_SRC)" --ascii > $@
88
89 readme: clean-readme $(README) readmecheck
90
91 clean-contrib:
92 -rm -f "$(CONTRIBUTING)"
93
94 $(CONTRIBUTING):
95 $(SPHINX2RST) "$(CONTRIBUTING_SRC)" > $@
96
97 contrib: clean-contrib $(CONTRIBUTING)
98
99 clean-pyc:
100 -find . -type f -a \( -name "*.pyc" -o -name "*$$py.class" \) | xargs rm
101 -find . -type d -name "__pycache__" | xargs rm -r
102
103 removepyc: clean-pyc
104
105 clean-build:
106 rm -rf build/ dist/ .eggs/ *.egg-info/ .tox/ .coverage cover/
107
108 clean-git:
109 $(GIT) clean -xdn
110
111 clean-git-force:
112 $(GIT) clean -xdf
113
114 test-all: clean-pyc
115 $(TOX)
116
117 test:
118 tox -e py
119
120 cov:
121 $(NOSETESTS) -xv --with-coverage --cover-html --cover-branch
122
123 build:
124 $(PYTHON) setup.py sdist bdist_wheel
125
126 distcheck: lint test clean
127
128 dist: readme contrib clean-dist build