/
Makefile
64 lines (53 loc) · 1.19 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
.DEFAULT_GOAL := help
SHELL := bash
DUTY = $(shell [ -n "${VIRTUAL_ENV}" ] || echo pdm run) duty
args = $(foreach a,$($(subst -,_,$1)_args),$(if $(value $a),$a="$($a)"))
check_quality_args = files
docs_serve_args = host port
release_args = version
test_args = match
BASIC_DUTIES = \
changelog \
check-dependencies \
clean \
coverage \
format \
release \
tox
QUALITY_DUTIES = \
check-quality \
check-jn-quality \
check-types \
check-jn-types \
test
.PHONY: help
help:
@$(DUTY) --list
.PHONY: lock
lock:
@pdm lock
.PHONY: check
check:
@$(DUTY) check-quality check-jn-quality check-types check-jn-types check-docs check-dependencies
.PHONY: uninstall
uninstall:
rm -rf .coverage*
rm -rf .mypy_cache
rm -rf .pytest_cache
rm -rf tests/.pytest_cache
rm -rf build
rm -rf dist
rm -rf htmlcov
rm -rf pip-wheel-metadata
rm -rf site
find . -type d -name __pycache__ | xargs rm -rf
find . -type d -name __pypackages__ | xargs rm -rf
find . -name pdm.lock | xargs rm -rf
find . -name .pdm.toml | xargs rm -rf
find . -name '*.rej' | xargs rm -rf
.PHONY: $(BASIC_DUTIES)
$(BASIC_DUTIES):
@$(DUTY) $@ $(call args,$@)
.PHONY: $(QUALITY_DUTIES)
$(QUALITY_DUTIES):
pdm run duty $@ $(call args,$@)