aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 9c2857899630c7cb206a34d376dfc54b6f575e26 (plain)
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
.PHONY: all output check test sphinx-apidoc documentation \
	check_style check_type check_pyright

all: output

DOC_OUTPUT = doc.rendered

OUTPUT_FLAGS = --path-base /code/muppet-strings/output \
			   --env ~/puppet/generated-environments/production/modules/

SCSS = scss

output: static-src/style.css
	python -m muppet $(OUTPUT_FLAGS)

check_style:
	flake8 muppet

check_type:
	mypy -p muppet

check_pyright:
	pyright $(shell find muppet -type f -name '*.py')

check: check_style check_type check_pyright

# TODO only require coverage if `python -m pytest -VV | grep pytest-cov` return true
PYTEST_FLAGS = --cov=muppet --cov-branch --cov-report=html

test:
	python -m pytest $(PYTEST_FLAGS) tests

sphinx-apidoc:
	sphinx-apidoc --separate --force -o doc muppet

$(DOC_OUTPUT)/index.html: sphinx-apidoc
	sphinx-build -b dirhtml doc $(DOC_OUTPUT)

documentation: $(DOC_OUTPUT)/index.html

clean:
	-rm -r output

static-src/style.css:
	$(MAKE) -C $(dir $@) $(notdir $@)

tags: $(shell find muppet -type f -name '*.py')
	ctags $^