Debian Codegraph @

Makefile

raw
1 PYTHON = python3
2
3 scripts = bin/test bin/irclog2html bin/logs2html bin/irclogsearch bin/irclogserver
4
5
6 .PHONY: all
7 all: $(scripts) ##: build a local buildout with all the scripts
8
9
10 .PHONY: test
11 test: ##: run tests
12 tox -p auto
13
14 .PHONY: flake8
15 flake8: ##: check for style problems
16 tox -e flake8
17
18 .PHONY: coverage
19 coverage: ##: measure test coverage
20 tox -e coverage
21
22 .PHONY: diff-cover
23 diff-cover: ##: find untested code on this branch
24 tox -e coverage
25 coverage xml
26 diff-cover coverage.xml
27
28 .PHONY: clean
29 clean: ##: clean up build artifacts
30 rm -f testcases/*.html testcases/*.css
31
32
33 .PHONY: releasechecklist
34 releasechecklist: check-date # also release.mk will add other checks
35
36
37 FILE_WITH_VERSION = src/irclog2html/_version.py
38 FILE_WITH_METADATA = src/irclog2html/_version.py
39 include release.mk
40
41 # override the release recipe in release.mk
42 define release_recipe =
43 $(default_release_recipe_publish_and_tag)
44 $(default_release_recipe_increment_and_push)
45 @echo "Then please create a GitHub release with"
46 @echo
47 @echo " gh release create"
48 @echo
49 endef
50
51 .PHONY: check-date
52 check-date:
53 @date_line="__date__ = '"`date +%Y-%m-%d`"'" && \
54 grep -q "^$$date_line$$" $(FILE_WITH_METADATA) || { \
55 echo "$(FILE_WITH_METADATA) doesn't specify $$date_line"; \
56 echo "Please run make update-date"; exit 1; }
57
58 .PHONY: update-date
59 update-date: ##: set release date in source code to today
60 sed -i -e "s/^__date__ = '.*'/__date__ = '"`date +%Y-%m-%d`"'/" $(FILE_WITH_METADATA)
61
62
63 python:
64 virtualenv -p $(PYTHON) python
65
66 python/bin/virtualenv:
67 python/bin/pip install -U setuptools virtualenv
68
69 bin/buildout: python bootstrap.py
70 python/bin/pip install -U setuptools
71 python/bin/python bootstrap.py
72 touch -c $@
73
74 $(scripts): bin/buildout buildout.cfg setup.py python/bin/virtualenv
75 bin/buildout
76 touch -c $(scripts)