-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGenerateData.sh
More file actions
executable file
·38 lines (29 loc) · 1 KB
/
GenerateData.sh
File metadata and controls
executable file
·38 lines (29 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
#!/bin/bash
set -e
# Generates data
# ==============
# Before running the tests, run this script once.
# It will generate the test data needed by noa.
# All existing generated assets will be overwritten.
# some colours in our life
GREEN='\033[0;32m'
RED='\033[0;31m'
NC='\033[0m'
# ensure minimum python version
if python -c 'import sys; sys.exit(sys.version_info[:2] >= (3,8))' > /dev/null ; then
>&2 echo -e "${RED}ERROR: \"python\" should point to python3.8 or newer${NC}"
exit 1
fi
python -m venv env_noa_data
source env_noa_data/bin/activate
pip install -e .
# generate assets
echo -e "${GREEN}noa-tests: generating data - start${NC}"
find assets -type f -name "Data*.py" -exec echo "noa-tests: running" {} \; -exec python {} \;
echo -e "${GREEN}noa-tests: generating data - done${NC}"
NOA_DATA_PATH="$(
cd "$(dirname "$0")" >/dev/null 2>&1 || exit
pwd -P
)" # https://stackoverflow.com/questions/4774054
echo -e "${GREEN}noa-tests: remember to export NOA_DATA_PATH=\"${NOA_DATA_PATH}\"${NC}"
deactivate