-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
61 lines (50 loc) · 1.4 KB
/
Makefile
File metadata and controls
61 lines (50 loc) · 1.4 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
# 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: clean
clean: uninstall
@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: upgrade
upgrade: install
prek auto-update --freeze
$(MAKE) prek
.PHONY: wheel
wheel:
./ci/build-wheel.sh --install
.PHONY: tests
tests: wheel
./ci/install-tools.sh --tests
cp pyproject.toml $(COV_TMPDIR)/
cp -a tests/ $(COV_TMPDIR)/
cd $(COV_TMPDIR) && pytest -nauto -v || true
.PHONY: cov
cov: wheel
./ci/install-tools.sh --tests
@rm -rf build/coverage_html_report
cp pyproject.toml $(COV_TMPDIR)/
cp -a tests/ $(COV_TMPDIR)/
cd $(COV_TMPDIR) && coverage run || true
coverage combine --keep --quiet -a $(COV_TMPDIR)/
coverage report
coverage html --show-contexts