-
Notifications
You must be signed in to change notification settings - Fork 13
/
Makefile
68 lines (48 loc) · 2.04 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
PY_FILES= find . -type f -not -path '*/\.*' | grep -i '.*[.]py$$' 2> /dev/null
DOC_FILES= find . -type f -not -path '*/\.*' | grep -i '.*[.]rst\$\|.*[.]md\$\|.*[.]css\$\|.*[.]py\$\|mkdocs\.yml\|CHANGES\|TODO\|.*conf\.py' 2> /dev/null
ALL_FILES= find . -type f -not -path '*/\.*' | grep -i '.*[.]py\$\|.*[.]rst\$\|.*[.]md\$\|.*[.]css\$\|.*[.]py\$\|mkdocs\.yml\|CHANGES\|TODO\|.*conf\.py' 2> /dev/null
entr_warn:
@echo "----------------------------------------------------------"
@echo " ! File watching functionality non-operational ! "
@echo " "
@echo "Install entr(1) to automatically run tasks on file change."
@echo "See http://entrproject.org/ "
@echo "----------------------------------------------------------"
test:
uv run py.test $(test)
start:
$(MAKE) test; uv run ptw .
watch_test:
if command -v entr > /dev/null; then ${ALL_FILES} | entr -c $(MAKE) test; else $(MAKE) test entr_warn; fi
vulture:
uv run vulture unihan_etl
watch_vulture:
if command -v entr > /dev/null; then ${PY_FILES} | entr -c $(MAKE) vulture; else $(MAKE) vulture entr_warn; fi
build_docs:
$(MAKE) -C docs html
watch_docs:
if command -v entr > /dev/null; then ${DOC_FILES} | entr -c $(MAKE) build_docs; else $(MAKE) build_docs entr_warn; fi
serve_docs:
$(MAKE) -C docs serve
dev_docs:
$(MAKE) -j watch_docs serve_docs
start_docs:
$(MAKE) -C docs start
design_docs:
$(MAKE) -C docs design
ruff_format:
uv run ruff format .
ruff:
uv run ruff check .
watch_ruff:
if command -v entr > /dev/null; then ${PY_FILES} | entr -c $(MAKE) ruff; else $(MAKE) ruff entr_warn; fi
mypy:
uv run mypy `${PY_FILES}`
watch_mypy:
if command -v entr > /dev/null; then ${PY_FILES} | entr -c $(MAKE) mypy; else $(MAKE) mypy entr_warn; fi
format_markdown:
prettier --parser=markdown -w *.md docs/*.md docs/**/*.md CHANGES
monkeytype_create:
uv run monkeytype run `uv run which py.test`
monkeytype_apply:
uv run monkeytype list-modules | xargs -n1 -I{} sh -c 'uv run monkeytype apply {}'