-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
63 lines (51 loc) · 1.5 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
venv_name = venv
venv_activate_path := ./$(venv_name)/bin/activate
package_name = neural_lifetimes
cov_args := --cov $(package_name) --cov-report=term-missing
not_slow = -m "not slow"
.PHONY: clean venv lint test slowtest cov slowcov docs
clean:
rm -rf ./$(venv_name)
venv:
python3 -m venv $(venv_name) ;\
. $(venv_activate_path) ;\
pip install --upgrade pip setuptools wheel ;\
pip install --upgrade -r requirements-dev.txt ;\
pip install --upgrade -r requirements.txt
update:
. $(venv_activate_path) ;\
pip install --upgrade pip setuptools wheel ;\
pip install --upgrade -r requirements-dev.txt ;\
pip install --upgrade -r requirements.txt
lint:
. $(venv_activate_path) ;\
flake8 $(package_name)/ ;\
flake8 tests/
test:
. $(venv_activate_path) ;\
py.test $(not_slow) --disable-warnings
slowtest:
. $(venv_activate_path) ;\
py.test
cov:
. $(venv_activate_path) ;\
py.test $(cov_args) $(not_slow)
slowcov:
. $(venv_activate_path) ;\
py.test $(cov_args)
format:
. $(venv_activate_path) ;\
isort -rc . ;\
autoflake -r --in-place --remove-unused-variables $(package_name)/ ;\
autoflake -r --in-place --remove-unused-variables tests/ ;\
black $(package_name)/ --skip-string-normalization ;\
black tests/ --skip-string-normalization
checkformat:
. $(venv_activate_path) ;\
black $(package_name)/ --skip-string-normalization --check ;\
black tests/ --skip-string-normalization --check
docs:
. $(venv_activate_path) ;\
cd docs/ ;\
sphinx-apidoc -o . ../neural_lifetimes ;\
sphinx-build -b html . build