Debian Codegraph @

Makefile

raw
1 .PHONY: format flake8 mypy test
2
3 check: format-check flake8 mypy test
4
5 # Code formatting
6 format_targets := geneagrapher tests
7
8 format:
9 poetry run black $(format_targets)
10 fmt: format
11 black: format
12
13 format-check:
14 poetry run black --check $(format_targets)
15
16 # Linting
17 flake8:
18 poetry run flake8
19 flake: flake8
20 lint: flake8
21
22 # Type enforcement
23 mypy:
24 poetry run mypy --strict geneagrapher tests
25 types: mypy
26
27 # Tests
28 test:
29 poetry run pytest tests
30
31 # Images (for the README)
32 image-targets = images/chioniadis-geneagraph.png images/curry-geneagraph.png images/ryff-zwinger-geneagraph.png images/zwinger-geneagraph.png
33 images: $(image-targets)
34
35 chioniadis.dot: ids = 201288:a
36 curry.dot: ids = 7398:d
37 ryff-zwinger.dot: ids = 125148:a 130248:a
38 zwinger.dot: ids = 125148:a
39
40 $(image-targets): images/%-geneagraph.png: %.png
41 optipng -o5 $? -clobber -out $@
42 %.png: %.dot
43 dot -Tpng -Gdpi=150 $? > $@
44 %.dot:
45 poetry run python -m geneagrapher.geneagrapher $(ids) | sed s/‐/-/g > $@
46
47 clean-images:
48 rm -rf chioniadis.dot chioniadis.png curry.dot curry.png ryff-zwinger.dot ryff-zwinger.png zwinger.dot zwinger.png images/*-geneagraph.png.bak
49
50 all:
51
52 clean:
53 rm -rf dist