-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
40 lines (30 loc) · 857 Bytes
/
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
.PHONY: all clean pytest coverage flake8 black mypy isort
CMD:=poetry run
PYMODULE:=src
TESTS:=tests
# Run all the checks which do not change files
all: mypy pytest flake8
# Run the unit tests using `pytest`
pytest:
$(CMD) pytest $(PYMODULE) $(TESTS)
# Generate a unit test coverage report using `pytest-cov`
coverage:
$(CMD) pytest --cov=$(PYMODULE) $(TESTS) --cov-report html
# Lint the code using `flake8`
flake8:
$(CMD) flake8 $(PYMODULE) $(TESTS)
# Automatically format the code using `black`
black:
$(CMD) black $(PYMODULE) $(TESTS)
# Perform static type checking using `mypy`
mypy:
$(CMD) mypy $(PYMODULE) $(TESTS)
# Order the imports using `isort`
isort:
$(CMD) isort $(PYMODULE) $(TESTS)
# Run the mkdocs dev server
docserve:
$(CMD) mkdocs serve
clean:
find . -type f -name *.pyc -delete
find . -type d -name __pycache__ -delete