forked from yandex-research/rtdl
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
51 lines (39 loc) · 1.04 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
.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:
find rtdl -type f -name "*.py[co]" -delete -o -type d -name __pycache__ -delete
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:
if [[ $(shell uname -m) != "arm64" ]]; then\
make -C $(DOCS_DIR) docs SPHINXOPTS="-W -b spelling";\
fi
lint:
python -m pre_commit_hooks.debug_statement_hook **/*.py
isort rtdl --check-only
black rtdl --check
flake8 rtdl
# the order is important: clean must be first, docs must precede dtest
pre-commit: clean lint typecheck test docs dtest spelling
test:
PYTHONPATH='.' $(PYTEST_CMD) $(ARGV)
typecheck:
mypy rtdl