-
-
Notifications
You must be signed in to change notification settings - Fork 241
Expand file tree
/
Copy pathMakefile
More file actions
87 lines (73 loc) · 1.99 KB
/
Copy pathMakefile
File metadata and controls
87 lines (73 loc) · 1.99 KB
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
# Makefile to automate some tools
SHELL=/bin/bash
PATH := $(shell python -c "import sysconfig; print(sysconfig.get_path('scripts'))"):$(PATH)
PY_PLATFORM := $(shell python -c "import sysconfig; print(sysconfig.get_platform())")
PRE_COMMIT_OPTIONS := --show-diff-on-failure --color=always --all-files --hook-stage=manual --no-progress
COV_TMPDIR := $(shell mktemp -d)
.PHONY: all
all: install
.PHONY: prek
prek: install
@(prek run $(PRE_COMMIT_OPTIONS) || true) | more
@prek cache gc -q
.PHONY: pylint
pylint:
uvx pylint -j 0 cx_Freeze
.PHONY: clean
clean: uninstall
@$(MAKE) -C doc clean
@rm -f .coverage* || true
@rm -rf build dist wheelhouse
@prek cache clean -q
.PHONY: install
install:
./ci/install-tools.sh --dev
if ! [ -f .git/hooks/pre-commit ]; then\
prek install --install-hooks --overwrite -t pre-commit;\
fi
.PHONY: uninstall
uninstall:
@prek uninstall -q
@rm -f .git/hooks/pre-commit
.PHONY: update
update: install
prek update --freeze
$(MAKE) prek
.PHONY: html
html:
@if [ -f .git/hooks/pre-commit ]; then\
prek run blacken-docs $(PRE_COMMIT_OPTIONS);\
prek run build-docs $(PRE_COMMIT_OPTIONS);\
else\
$(MAKE) -C doc html;\
fi
@echo -n "Wrote HTML documentation to "
@echo -e "\e]8;;file://$(PWD)/build/doc/html/index.html\e\\\build/doc/html\e]8;;\e\\"
.PHONY: doc
doc:
$(MAKE) -C doc html
$(MAKE) -C doc epub
$(MAKE) -C doc pdf
.PHONY: wheel
wheel:
./ci/build-wheel.sh --install
.PHONY: tests
tests: wheel
./ci/install-tools.sh --tests
cp pyproject.toml $(COV_TMPDIR)/
cp -a samples $(COV_TMPDIR)/
cp -a tests $(COV_TMPDIR)/
cp -a wheelhouse $(COV_TMPDIR)/
cd $(COV_TMPDIR) && pytest --dist=loadfile -nauto -v -rpfEsXx tests|| true
.PHONY: cov
cov: wheel
./ci/install-tools.sh --tests
@rm -rf build/coverage_html_report
cp pyproject.toml $(COV_TMPDIR)/
cp -a samples $(COV_TMPDIR)/
cp -a tests $(COV_TMPDIR)/
cp -a wheelhouse $(COV_TMPDIR)/
cd $(COV_TMPDIR) && coverage run ||true
coverage combine --keep --quiet -a $(COV_TMPDIR)/
coverage report
coverage html