forked from py-why/causaltune
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
57 lines (45 loc) · 1.3 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
package_name = causaltune
coverage_target = 70
max_line_length = 120
venv_name = venv
venv_activate_path := ./$(venv_name)/bin/activate
cov_args := --cov $(package_name) --cov-fail-under=$(coverage_target) --cov-report=term-missing
not_slow = -m "not slow"
.PHONY: venv cov test
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 -r requirements-dev.txt ;\
pip install --upgrade -r requirements.txt
lint:
. $(venv_activate_path) ;\
flake8 --max-line-length=$(max_line_length)
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 .
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