forked from Perfexionists/perun
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
70 lines (56 loc) · 2.56 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
help:
@echo "Perun - Lightweight Performance Control System"
@echo ""
@echo "For best developer experience, make sure to use a virtual environment."
@echo "For more information about how to contribute, see the CONTRIBUTING file."
@echo ""
@echo "Main commands:"
@echo " dev Install all dependencies and set up an editable environment"
@echo " install Install the project"
@echo " lint Run linters (black, pylint)"
@echo " check Run static type checker (mypy)"
@echo " test Run tests with pytest"
@echo " release Generate sdist and wheel"
@echo " docs Generate documentation (html, dirhtml)"
@echo ""
@echo "Extra commands:"
@echo " docs-html Generate only HTML documentation"
@echo " docs-dirhtml Generate only HTML documentation (with directories)"
@echo " docs-latex Generate only PDF doxcumentation with LaTeX"
@echo " docs-all Generate all documentation (html, dirhtml, latex)"
@echo " docs-release Generate all documentation and update the project PDF documentation"
@echo " test-ci Run tests with pytest (suitable for CI)"
.PHONY: help dev install check lint test release docs docs-release docs-all docs-html docs-dirhtml docs-latex
# Base build requirements are not installed automatically.
# Inspired by https://meson-python.readthedocs.io/en/latest/how-to-guides/editable-installs.html
dev:
$(info [INFO] Make sure you're using a virtual environment for development)
python3 -m pip install meson-python meson ninja
python3 -m pip install --no-build-isolation --config-settings=editable-verbose=true --config-settings=setup-args=-Dbuildtype=debug --editable .[test,typing,lint,docs]
pre-commit install
install:
pip3 install .[test]
check:
python3 -m mypy ./perun/
lint:
python3 -m black -q ./perun/
python3 -m pylint --jobs 0 ./perun/ || true
test:
python3 -m pytest --durations=10 --cov=./ --cov-report term-missing:skip-covered ./tests/
# In the CI environemnt we want to see all the tests and want coverage report to be in XML
# because the results are being uploaded to Codecov.
test-ci:
python3 -m pytest --cov=./ --cov-report xml --cov-report term-missing:skip-covered ./tests/
release:
python3 -m build --sdist
docs: docs-html docs-dirhtml
docs-release: docs-all
cp ./docs/_build/latex/Perun.pdf ./docs/pdf/perun.pdf
# Ensure all dependencies (e.g., sphinx, latexmk) are installed.
docs-all: docs-html docs-dirhtml docs-latex
docs-html:
$(MAKE) -C ./docs html
docs-dirhtml:
$(MAKE) -C ./docs dirhtml
docs-latex:
$(MAKE) -C ./docs latex