-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
executable file
·133 lines (108 loc) · 4.03 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#/***************************************************************************
#
# Toolbox for working with 3Di hydraulic models
# -------------------
# begin : 2016-03-04
# git sha : $Format:%H$
# copyright : (C) 2016 by Nelen&Schuurmans
# email : servicedesk@nelen-schuurmans.nl
# ***************************************************************************/
#
#/***************************************************************************
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it under the terms of the GNU General Public License as published by *
# * the Free Software Foundation; either version 2 of the License, or *
# * (at your option) any later version. *
# * *
# ***************************************************************************/
#################################################
# Edit the following to match your sources lists
#################################################
#Add iso code for any locales you want to support here (space separated)
# default is no locales
LOCALES =
# translation
SOURCES = __init__.py threedi_plugin.py
PLUGINNAME = threedi_results_analysis
PY_FILES = __init__.py
# ^^^ The rest of the python files is picked up because they're in git.
UI_FILES = ui/*.ui
EXTRAS = metadata.txt icon.png
HELP = help/build/html
default: compile
compile: external-dependencies/.generated.marker
# .generated.marker is generated by populate.sh to signify completion.
external-dependencies/.generated.marker: constraints.txt external-dependencies/populate.sh
cd external-dependencies && ./populate.sh
constraints.txt: dependencies.py
python3 dependencies.py
test: clean compile
@echo "#### Python tests"
QT_QPA_PLATFORM=offscreen pytest
# Note: setup.cfg configures the generic options (like --cov) that are
# passed to pytest.
docstrings:
@echo "#### Docstring coverage report"
python3 scripts/docstring-report.py
zip: compile
@echo
@echo "---------------------------"
@echo "Creating plugin zip bundle."
@echo "---------------------------"
rm -rf /tmp/$(PLUGINNAME)
cd /tmp; cp -r $(CURDIR) $(PLUGINNAME)
rm -rf /tmp/$(PLUGINNAME)/tests
rm -rf /tmp/$(PLUGINNAME)/tool_statistics/tests
rm -rf /tmp/$(PLUGINNAME)/tool_water_balance/tests
rm -rf /tmp/$(PLUGINNAME)/.git
rm -rf /tmp/$(PLUGINNAME)/*.zip
rm -rf /tmp/$(PLUGINNAME)/Docker
rm -rf /tmp/$(PLUGINNAME)/docker-compose.yml
rm -rf /tmp/$(PLUGINNAME)/docker-compose.override.yml
rm -rf /tmp/$(PLUGINNAME)/external-dependencies/h5py
rm -rf /tmp/$(PLUGINNAME)/external-dependencies/scipy
rm -rf /tmp/$(PLUGINNAME)/deps
rm -rf /tmp/$(PLUGINNAME)/__pycache__
find /tmp/$(PLUGINNAME) -iname "*.pyc" -delete
cd /tmp; zip -9r $(CURDIR)/$(PLUGINNAME).zip $(PLUGINNAME)
check: constraints.txt
# Use pip-compile to check whether all dependencies version constraints are met.
cp constraints.txt requirements.in
pip-compile --dry-run
rm requirements.in
package: compile
# Create a zip package of the plugin named $(PLUGINNAME).zip.
# This requires use of git (your plugin development directory must be a
# git repository).
# To use, pass a valid commit or tag as follows:
# make package VERSION=Version_0.3.2
@echo
@echo "------------------------------------"
@echo "Exporting plugin to zip package. "
@echo "------------------------------------"
rm -f $(PLUGINNAME).zip
git archive --prefix=$(PLUGINNAME)/ -o $(PLUGINNAME).zip $(VERSION)
echo "Created package: $(PLUGINNAME).zip"
html:
@echo
@echo "------------------------------------"
@echo "Building documentation using sphinx."
@echo "------------------------------------"
python3 scripts/generate-reference-docs.py
cd doc; make html
@echo "Open doc/build/html/index.html to see the documentation"
flake8:
@echo "#### PEP8/pyflakes issues"
@flake8 . --extend-exclude=deps
@echo "No issues found."
beautiful:
isort .
black .
flake8 .
clean:
@echo
@echo "------------------------------------"
@echo "Deleting dependencies"
@echo "------------------------------------"
rm -rf deps