-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
59 lines (45 loc) · 1.13 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
.PHONY:
.DEFAULT_GOAL := help
SRC_DIRS := src tests benchmark
define PRINT_HELP_PYSCRIPT
import re, sys
for line in sys.stdin:
match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line)
if match:
target, help = match.groups()
print("%-20s %s" % (target, help))
endef
export PRINT_HELP_PYSCRIPT
.PHONY: help
help:
@python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
# .PHONY: lint
# lint: format-check pylint mypy ## Run all lint task
# .PHONY: pylint
# pylint:
# poetry run pylint --unsafe-load-any-extension=y -j 0 $(SRC_DIRS) --disable=C0114,C0115,C0116
.PHONY: format-check
format-check: ## Just check format
poetry run black $(SRC_DIRS) --check
.PHONY: format
format: ## Black & isort the code
poetry run black $(SRC_DIRS)
poetry run isort $(SRC_DIRS)
# .PHONY: pydoc
# pydoc:
# poetry run pydocstyle renaissance
# .PHONY: mypy
# mypy:
# poetry mypy $(SRC_DIRS)
.PHONY: gendocs
gendocs:
sphinx-apidoc -o docs/source src/poga
.PHONY: docs
docs:
sphinx-build -b html docs/source docs/build/html
.PHONY: localinstall
localinstall:
pip install -e .
.PHONY: demo
demo:
poetry run bash -c 'cd src/example/ && python main.py'