-
-
Notifications
You must be signed in to change notification settings - Fork 24
/
Makefile
76 lines (55 loc) · 1.88 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
PYTHON = python3
scripts = bin/test bin/irclog2html bin/logs2html bin/irclogsearch bin/irclogserver
.PHONY: all
all: $(scripts) ##: build a local buildout with all the scripts
.PHONY: test
test: ##: run tests
tox -p auto
.PHONY: flake8
flake8: ##: check for style problems
tox -e flake8
.PHONY: coverage
coverage: ##: measure test coverage
tox -e coverage
.PHONY: diff-cover
diff-cover: ##: find untested code on this branch
tox -e coverage
coverage xml
diff-cover coverage.xml
.PHONY: clean
clean: ##: clean up build artifacts
rm -f testcases/*.html testcases/*.css
.PHONY: releasechecklist
releasechecklist: check-date # also release.mk will add other checks
FILE_WITH_VERSION = src/irclog2html/_version.py
FILE_WITH_METADATA = src/irclog2html/_version.py
include release.mk
# override the release recipe in release.mk
define release_recipe =
$(default_release_recipe_publish_and_tag)
$(default_release_recipe_increment_and_push)
@echo "Then please create a GitHub release with"
@echo
@echo " gh release create"
@echo
endef
.PHONY: check-date
check-date:
@date_line="__date__ = '"`date +%Y-%m-%d`"'" && \
grep -q "^$$date_line$$" $(FILE_WITH_METADATA) || { \
echo "$(FILE_WITH_METADATA) doesn't specify $$date_line"; \
echo "Please run make update-date"; exit 1; }
.PHONY: update-date
update-date: ##: set release date in source code to today
sed -i -e "s/^__date__ = '.*'/__date__ = '"`date +%Y-%m-%d`"'/" $(FILE_WITH_METADATA)
python:
virtualenv -p $(PYTHON) python
python/bin/virtualenv:
python/bin/pip install -U setuptools virtualenv
bin/buildout: python bootstrap.py
python/bin/pip install -U setuptools
python/bin/python bootstrap.py
touch -c $@
$(scripts): bin/buildout buildout.cfg setup.py python/bin/virtualenv
bin/buildout
touch -c $(scripts)