-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
120 lines (83 loc) Β· 2.09 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
default: install-dev
all: install-dev fmt-check lint typecheck unit
h help:
@grep '^[a-z#]' Makefile
.PHONY: hooks
hooks:
cd .git/hooks && ln -s -f ../../hooks/pre-push pre-push
install-dev:
pip install pip --upgrade
pip install -r requirements-dev.txt
upgrade:
pip install pip --upgrade
pip install -r requirements-dev.txt --upgrade
# Run all configured tasks in main VAR targets dir.
run:
python3 -m unicron.unicron --verbose
run-quiet:
python3 -m unicron.unicron
# View configured tasks.
ls-tasks:
ls -l unicron/var/targets/
ls-test-tasks:
ls -l unicron/_test_var/targets/
# View last run dates for configured tasks.
ls-runs:
cd unicron/var/last_run/ && tail *
ls-test-runs:
cd unicron/_test_var/last_run/ && tail *
# Make all task scripts executable.
perms:
chmod +x unicron/var/targets/*
# Tail the app logs.
log-app:
cd unicron/var && tail -F app.log
# Same as above but with longer history.
log-app-long:
cd unicron/var && tail -n200 -F app.log
# Tail the task logs.
log-tasks:
cd unicron/var && tail -F output/*.log
log-tasks-long:
cd unicron/var && tail -n50 -F output/*.log
# Tail both the app and task logs.
log:
cd unicron/var && tail -F output/*.log app.log
# Tail logs created by `debug` target.
log-tests:
cd unicron/_test_var && tail -n20 -F output/*.log app.log
fmt:
black .
isort .
fmt-check:
black . --diff --check
isort . --diff --check-only
lint:
# Exit on error code on a fail. Expand failure to all non-fatal messages too.
pylint unicron tests || pylint-exit -efail -wfail -rfail -cfail $$?
fix: fmt lint
t typecheck:
mypy unicron tests
# Reset tasks and logs in the TEST VAR dir.
reset:
bin/reset.sh
unit: reset
TEST=true pytest
test-coverage: reset
TEST=true coverage run --source=unicron -m pytest
test-report:
coverage report -m
test: test-coverage test-report
# Run tests and serve coverage output explorer.
test-html: test-coverage
coverage html
npx docsify serve htmlcov
# Integration tests. Requires manual inspection.
debug: reset
bin/test.sh
clean:
find . -name '*.pyc' -delete
# Serve docs site.
.PHONY: docs
docs:
npx docsify serve docs