-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMakefile
61 lines (48 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
# Check Python major and minor version
# For more information, see https://stackoverflow.com/a/22105036
PYV = $(shell python -c "import sys;t='{v[0]}.{v[1]}'.format(v=list(sys.version_info[:2]));sys.stdout.write(t)")
# Note: use tabs (not spaces) for indentation
# actions which are virtual, i.e. not a script
.PHONY: install install-deps install-tb install-for-test freeze-deps upgrade-deps test test-core test-forecast test-viz ensure-deps-folder
install: install-deps install-tb
install-for-test:
pip install setuptools_scm pytest
install-deps:
pip install --upgrade pip-tools
pip-sync dev/${PYV}/requirements.txt
pip install pre-commit
install-tb:
pip install -e .
pre-commit install
freeze-deps:
make ensure-deps-folder
pip install --upgrade pip-tools
pip-compile -o dev/${PYV}/requirements.txt
upgrade-deps:
make ensure-deps-folder
pip install --upgrade pip-tools
pip-compile -o dev/${PYV}/requirements.txt --upgrade
ifneq ($(skip-test), yes)
make test
endif
test:
make test-core # test just the core, which may have fewer pinned dependencies
make test-all # test everything sharing the same dependencies
test-all:
pip install -e .[forecast,viz]
make install-for-test
pytest
test-core:
pip install -e .
make install-for-test
pytest --ignore test_forecast__ --ignore test_viz__
test-forecast:
pip install -e .[forecast]
make install-for-test
pytest -k test_forecast__
test-viz:
pip install -e .[viz]
make install-for-test
pytest -k test_viz__
ensure-deps-folder:
mkdir -p dev/${PYV}