forked from tmux-python/libtmux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
63 lines (44 loc) · 1.88 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
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 https://eradman.com/entrproject/ "
@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
build_docs:
$(MAKE) -C docs html
start_docs:
$(MAKE) -C docs design
design_docs:
$(MAKE) -C docs design
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
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 {}'