-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgo
More file actions
executable file
·56 lines (45 loc) · 1 KB
/
go
File metadata and controls
executable file
·56 lines (45 loc) · 1 KB
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
#!/bin/bash
set -eu
function ensure_venv {
test -n "${VIRTUAL_ENV+x}" && return
if [ ! -d venv ]; then
virtualenv -p /usr/local/bin/python3.6 venv
./venv/bin/pip install -r requirements.txt
fi
if [ requirements.txt -nt venv ]; then
./venv/bin/pip install -r requirements.txt
touch ./venv
fi
set +u
source ./venv/bin/activate
set -u
}
function ensure_custom_modules {
export PYTHONPATH=`pwd`
}
function task_lint {
PY_FILES=$(find . -name "*.py" -not -path "./venv/*")
flake8 --ignore=E501 ${PY_FILES}
}
function task_format {
ensure_venv
PY_FILES=$(find . -name "*.py" -not -path "./venv/*")
yapf -i ${PY_FILES}
}
function task_usage {
echo "Usage: $0 preprocess-svcomp-data | format"
exit 1
}
function task_preprocess_svcomp_data {
ensure_venv
ensure_custom_modules
# task_lint
python ui/preprocessing.py
}
CMD=${1:-}
shift || true
case ${CMD} in
preprocess-svcomp-data) task_preprocess_svcomp_data ;;
format) task_format ;;
*) task_usage ;;
esac