-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
72 lines (56 loc) · 1.68 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
package_name = tw_experimentation
coverage_target = 70
max_line_length = 88
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: clean venv update lint test slowtest cov slowcov
clean:
rm -rf ./$(venv_name)
venv:
python3 -m venv $(venv_name) ;\
. $(venv_activate_path) ;\
pip install --upgrade pip setuptools wheel ;\
pip install --upgrade -r envs/requirements-dev.txt ;\
pip install --upgrade -r envs/requirements.txt
venvdev:
python3 -m venv $(venv_name) ;\
. $(venv_activate_path) ;\
pip install --upgrade pip setuptools wheel ;\
pip install --upgrade -r envs/requirements-dev.txt ;\
update:
. $(venv_activate_path) ;\
pip install --upgrade -r envs/requirements-dev.txt ;\
pip install --upgrade -r envs/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)
streamlit-run:
streamlit run tw_experimentation/streamlit/Main.py
run-streamlit-poetry:
poetry run streamlit run tw_experimentation/streamlit/Main.py
set-up-poetry-mac:
pip install poetry ;\
poetry config virtualenvs.in-project true ;\
brew install pyenv ;\
pyenv install --list | grep " 3\.[9]" ;\
poetry install
set-up-poetry-windows:
pip install poetry ;\
poetry config virtualenvs.in-project true ;\
pip install pyenv-win ;\
pyenv-win install --list | grep " 3\.[9]" ;\
poetry install