-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
51 lines (33 loc) · 1.23 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
# Console Makefile
include Makefile.common
ver_pattern := version =
# Python script to render a Jinja template, works around PyPI limitations
define JINJA_FU
from os import environ
from jinja2 import Environment
j2 = Environment(trim_blocks=True, lstrip_blocks=True)
with open('docs/readme.templ') as f:
template = j2.from_string(f.read())
print(template.render(mode=environ['RM_MODE']))
endef
export JINJA_FU
demos: ## Show various functionality
echo | CLICOLOR_FORCE=1 python3 -m console.demos -d # works oddly under make
docs: docs/readme.rst README.rst docs-default
rsync --recursive --human-readable --delete-before --update docs/_build/html/ ../../mixmastamyk.bitbucket.org/console/
docs/readme.rst: docs/readme.templ
RM_MODE=sphx python3 -c "$$JINJA_FU" > docs/readme.rst
README.rst: docs/readme.templ
RM_MODE=pypi python3 -c "$$JINJA_FU" > README.rst
publish: publish-default
DOC_DIR='../../mixmastamyk.bitbucket.org/console'
if [ -d "$$DOC_DIR" ]; then
cd "$$DOC_DIR" \
&& git add . && git commit -m . && git push
fi
test: ## Test suite
-pyflakes *.py */*.py ; \
if [ $$? -ne 0 ] ; then sleep 3 ; fi
tput reset # clear screen, scrollback
pytest --color=no --showlocals --verbose
.PHONY: demos docs publish test