-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
93 lines (71 loc) · 1.54 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
RUN = poetry run
PATHS = evento tests examples
# Code style
.PHONY: format
format:
${RUN} isort ${PATHS}
${RUN} black ${PATHS}
.PHONY: format-check
format-check:
${RUN} isort --check-only ${PATHS}
${RUN} black --check ${PATHS}
.PHONY: lint
lint:
${RUN} flake8 ${PATHS}
.PHONY: tc # alias for typecheck
tc: typecheck
.PHONY: typecheck
typecheck:
${RUN} mypy ${PATHS}
.PHONY: stale
stale:
${RUN} vulture --min-confidence 100 ${PATHS}
.PHONY w:
w: watch
# Testing
.PHONY: watch
watch: clean/tests
${RUN} ptw -n --runner "pytest --testmon ${scope}"
.PHONY: watch/focus
watch/focus:
${RUN} ptw -n --runner "pytest --testmon -m focus ${scope}"
.PHONY: f # alias for watch/focus
f: watch/focus
.PHONY: t # alias for test
t: test
.PHONY: test
test:
${RUN} pytest ${scope}
.PHONY: test/focus
test/focus:
${RUN} pytest -m focus ${scope}
.PHONY: v # alias for validate
v: validate
.PHONY: vv
vv: format lint typecheck stale
.PHONY: validate
validate: vv test
# Maintenance
.PHONY: clean
clean: clean/builds clean/cache clean/tests clean/files
.PHONY: clean/files
clean/files:
rm -fr tmp/files
rm -fr tmp/emails
.PHONY: clean/cache
clean/cache:
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -fr {} +
.PHONY: clean/builds
clean/builds:
rm -fr .eggs/
find . -name '*.egg-info' -exec rm -fr {} +
find . -name '*.egg' -exec rm -f {} +
.PHONY: clean/tests
clean/tests:
rm -fr coverage/
rm -fr .testmondata
rm -fr .pytest_cache
rm -fr .mypy_cache