forked from yandex-research/rtdl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
55 lines (43 loc) · 1.09 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
.PHONY: default clean coverage _docs docs dtest format lint pages pre-commit spelling test typecheck
PYTEST_CMD = pytest rtdl
VIEW_HTML_CMD = open
DOCS_DIR = docs
default:
echo "Hello, World!"
clean:
for x in "bin" "lib" "rtdl"; \
do \
find $$x -type f -name "*.py[co]" -delete -o -type d -name __pycache__ -delete; \
done;
rm -f .coverage
rm -rf .ipynb_checkpoints
rm -rf .mypy_cache
rm -rf .pytest_cache
rm -rf dist
rm -rf $(DOCS_DIR)/api
make -C $(DOCS_DIR) clean
coverage:
coverage run -m $(PYTEST_CMD)
coverage report -m
docs:
make -C $(DOCS_DIR) html
_docs: docs
$(VIEW_HTML_CMD) $(DOCS_DIR)/build/html/index.html
dtest:
make -C $(DOCS_DIR) doctest
spelling:
make -C $(DOCS_DIR) docs SPHINXOPTS="-W -b spelling"
lint:
python -m pre_commit_hooks.debug_statement_hook **/*.py
for x in "bin" "lib" "rtdl"; \
do \
isort $$x --check-only; \
black $$x --check; \
flake8 $$x; \
done;
# the order is important: clean must be first, docs must precede dtest
pre-commit: clean lint test docs dtest spelling typecheck
test:
PYTHONPATH='.' $(PYTEST_CMD) $(ARGV)
typecheck:
mypy rtdl