forked from FlexMeasures/flexmeasures
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
89 lines (66 loc) · 2.59 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
# Note: use tabs
# actions which are virtual, i.e. not a script
.PHONY: install install-for-dev install-deps install-flexmeasures run-local test freeze-deps upgrade-deps update-docs update-docs-pdf show-file-space show-data-model
# ---- Development ---
run-local:
python run-local.py
test:
make install-for-test
pytest
# ---- Documentation ---
update-docs:
@echo "Creating docs environment ..."
make install-docs-dependencies
@echo "Creating documentation ..."
cd documentation; make clean; make html SPHINXOPTS="-W --keep-going -n"; cd ..
update-docs-pdf:
@echo "NOTE: PDF documentation requires packages (on Debian: latexmk texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended)"
@echo "NOTE: Currently, the docs require some pictures which are not in the git repo atm. Ask the devs."
make install-sphinx-tools
cd documentation; make clean; make latexpdf; make latexpdf; cd .. # make latexpdf can require two passes
# ---- Installation ---
install: install-deps install-flexmeasures
install-for-dev:
make freeze-deps
pip-sync requirements/app.txt requirements/dev.txt requirements/test.txt
make install-flexmeasures
install-for-test:
pip-sync requirements/app.txt requirements/dev.txt requirements/test.txt
make install-flexmeasures
install-deps:
make install-pip-tools
make freeze-deps
pip-sync requirements/app.txt
install-flexmeasures:
python setup.py develop
install-pip-tools:
pip3 install -q "pip-tools>=6.4"
install-docs-dependencies:
pip install -r requirements/docs.txt
freeze-deps:
make install-pip-tools
pip-compile -o requirements/app.txt requirements/app.in
pip-compile -o requirements/test.txt requirements/test.in
pip-compile -o requirements/dev.txt requirements/dev.in
pip-compile -o requirements/docs.txt requirements/docs.in
upgrade-deps:
make install-pip-tools
pip-compile --upgrade -o requirements/app.txt requirements/app.in
pip-compile --upgrade -o requirements/test.txt requirements/test.in
pip-compile --upgrade -o requirements/dev.txt requirements/dev.in
pip-compile --upgrade -o requirements/docs.txt requirements/docs.in
make test
# ---- Data ----
show-file-space:
# Where is our file space going?
du --summarize --human-readable --total ./* ./.[a-zA-Z]* | sort -h
upgrade-db:
flask db current
flask db upgrade
flask db current
show-data-model:
# This generates the data model, as currently written in code, as a PNG picture.
# Also try with --schema for the database model.
# With --dev, you'll see the currently experimental parts, as well.
# Use --help to learn more.
./flexmeasures/data/scripts/visualize_data_model.py --uml --dev