-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
70 lines (53 loc) · 1.46 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
.PHONY: test htmlcov typescov docs
.DEFAULT_GOAL := test
SRC = flask_dialogflow/
TESTS = test/
test:
pytest
testcov:
pytest --cov=$(SRC) --cov-report term $(TESTS)
htmltestcov:
pytest --cov=$(SRC) --cov-report html $(TESTS)
open htmlcov/index.html
mypy:
mypy --config-file .mypy.ini $(SRC) $(TESTS)
mypycov:
mypy --html-report typescov/ $(SRC) $(TESTS)
open typescov/index.html
flake:
flake8 --config=.flake8 $(SRC) $(TESTS)
# Docstrings check
#
# Diabled for now as pydocstyle does not support Google style docstrings.
# Watch this issue for updates: https://github.com/PyCQA/pydocstyle/issues/275
# pydocstyle $(SRC)
lint:
pylint $(SRC) $(TESTS)
# Build and open the Sphinx documentation in the default dir hierarchy
docs:
cd docs/ && $(MAKE) html && open _build/html/index.html
clean: clean-build clean-pyc clean-test
# Remove build artifacts
clean-build:
rm -fr build/
rm -fr dist/
rm -fr .eggs/
find . -name '*.egg-info' -exec rm -fr {} +
find . -name '*.egg' -exec rm -f {} +
cd docs/ && $(MAKE) clean
# Remove Python file artifacts
clean-pyc:
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -fr {} +
# Remove test and coverage artifacts
clean-test:
rm -f .coverage
rm -fr htmlcov/
rm -fr .pytest_cache
rm -rf typescov/
rm -rf .mypy_cache/
rm -rf .pylint_cache/
# Run all inspections before a pull request
pr: clean test testcov mypy flake lint