-
Notifications
You must be signed in to change notification settings - Fork 78
/
Makefile
107 lines (83 loc) · 2.85 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
CEBRA_VERSION := 0.4.0
dist:
python3 -m pip install virtualenv
python3 -m pip install --upgrade build twine
python3 -m build --wheel --sdist
build: dist
archlinux:
mkdir -p dist/arch
cp PKGBUILD dist/arch
cp dist/cebra-${CEBRA_VERSION}.tar.gz dist/arch
(cd dist/arch; makepkg --skipchecksums -f)
# NOTE(stes): Ensure that no old tempfiles are present. Ideally, move this into
# the test pipeline directly.
clean_test:
rm -rf auxiliary_behavior_data.h5 data.npz neural_data.npz saved_models grid_search_models
test: clean_test
python -m pytest --ff --doctest-modules -m "not requires_dataset" tests ./docs/source/usage.rst cebra
doctest: clean_test
python -m pytest --ff --doctest-modules -vvv ./docs/source/usage.rst
docker:
./tools/build_docker.sh
test_parallel: clean_test
python -m pytest -n auto --ff -m "not requires_dataset" tests
test_parallel_debug: clean_test
python -m pytest -n auto -x --ff -m "not requires_dataset" tests
test_all: clean_test
python -m pytest --ff --ignore cebra/grid_search.py tests cebra
test_fast: clean_test
python -m pytest --ff --ignore cebra/grid_search.py -m "not requires_dataset" tests cebra --runfast
# Run failed test firsts, using a single worker (for debugging)
test_debug: clean_test
python -m pytest -vvv -x --ff -m "not requires_dataset" tests
test_benchmark: clean_test
python -m pytest --ff -m "not requires_dataset" tests --runbenchmark
interrogate:
interrogate \
--ignore-property-decorators \
--ignore-init-method \
--verbose \
--ignore-semiprivate \
--ignore-private \
--ignore-magic \
--omit-covered-files \
-f 90 \
cebra
# Build documentation using sphinx
docs:
(cd docs && PYTHONPATH=.. make page)
docs-touch:
find docs/source -iname '*.rst' -exec touch {} \;
(cd docs && PYTHONPATH=.. make page)
docs-strict:
(cd docs && PYTHONPATH=.. SPHINXOPTS='-n' make page)
# Serve the docs
serve_docs:
python -m http.server 8080 --b 127.0.0.1 -d docs/build/html
# Serve the entire page
serve_page:
python -m http.server 8080 --b 127.0.0.1 -d docs/page
# Format code in the main package and docs
format:
yapf -i -p -r cebra
yapf -i -p -r tests
yapf -i -p -r docs/source/conf.py
# TODO(stes) Add back once upstream issue
# https://github.com/PyCQA/docformatter/issues/119
# is resolved.
# docformatter --config pyproject.toml -i cebra
# docformatter --config pyproject.toml -i tests
isort cebra/
isort tests/
codespell:
codespell cebra/ tests/ docs/source/*.rst *.md -L "nce, nd"
check_for_binary:
./tools/check_for_binary_files.sh
# Show code report (pylint and coverage)
report: check_docker format .coverage .pylint
cat .pylint
coverage report
.PHONY: dist build docker archlinux clean_test test doctest test_parallel \
test_parallel_debug test_all test_fast test_debug test_benchmark \
interrogate docs docs-touch docs-strict serve_docs serve_page \
format codespell check_for_binary