-
Notifications
You must be signed in to change notification settings - Fork 112
/
Makefile
72 lines (46 loc) · 1.63 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
65
66
67
68
69
70
71
72
.PHONY: build
build: setup.py
python3 -m pip install --upgrade build && python3 -m build
.PHONY: upload
upload:
python3 -m twine upload --repository pypi dist/*
.PHONY: upload-test
upload-test:
python3 -m twine upload --repository testpypi dist/*
.PHONY: clean
clean:
rm -rf build dist _vizdoom && find . -name "_vizdoom.ini" -delete && find . -type d -name "_vizdoom" -delete
line_len = 120
line_len_arg = --line-length $(line_len)
code_folders = ./
# Format source code automatically
.PHONY: format
format:
black $(line_len_arg) -t py38 $(code_folders)
isort $(line_len_arg) --py 38 --profile black $(code_folders)
# Check that source code meets quality standards
.PHONY: check-codestyle
check-codestyle:
black --check $(line_len_arg) -t py38 $(code_folders)
isort --check-only $(line_len_arg) --py 38 --profile black $(code_folders)
# ignore some formatting issues already covered by black
flake8 --max-line-length $(line_len) --ignore=E501,F401,E203,W503,E126,E722,E704 $(code_folders)
# Run tests for the library
.PHONY: test
test:
pytest -s --maxfail=2 -rA
# ; echo "Tests finished. You might need to type 'reset' and press Enter to fix the terminal window"
# Run code coverage test
.PHONY: test-cov
test-cov:
pytest --cov=./ -v
# ; echo "Tests finished. You might need to type 'reset' and press Enter to fix the terminal window"
# Run code coverage test
.PHONY: test-cov-core
test-cov-core:
pytest --cov=./ --cov-config=./.core-coveragerc -v
# ; echo "Tests finished. You might need to type 'reset' and press Enter to fix the terminal window"
# docs
.PHONY: docs-serve
docs-serve:
bash ./docs/cfg-params.sh && mkdocs serve