From 045ab337c3a5eb97505db5dd0ec7147f76c03d2e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Oriol=20Tint=C3=B3=20Prims?= <oriol.tinto@lmu.de>
Date: Thu, 16 Mar 2023 15:31:59 +0100
Subject: [PATCH] Fix build_python_environment.sh.

---
 conf/proj.yaml                        | 1 +
 templates/build_python_environment.sh | 7 ++++---
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/conf/proj.yaml b/conf/proj.yaml
index 9c86270..250f966 100644
--- a/conf/proj.yaml
+++ b/conf/proj.yaml
@@ -9,6 +9,7 @@ icon:
 python_environment:
   folder_name: python_environment
   requirements:
+    - numpy==1.23
     - enstools-compression
     # Just to try a library from a git repository.
     - https://gitlab.physik.uni-muenchen.de/Oriol.Tinto/otils.git
diff --git a/templates/build_python_environment.sh b/templates/build_python_environment.sh
index 5a7b226..42de8d0 100644
--- a/templates/build_python_environment.sh
+++ b/templates/build_python_environment.sh
@@ -53,11 +53,12 @@ ln -sf $(which python3) ${WORKDIR}/python3
 
 # Install the requirements via pip
 # TODO: Due to a incompatibility issue between latest numba and numpy I have to add this here. Hopefully removable soon.
-requirements=%python_environment.requirements%
+requirements="%python_environment.requirements%"
 
-echo ${requirements}
+# Convert list with python format to a bash array
+requirements=($( echo ${requirements} | tr -d '[],'))
 
 # Install requirements.
-for requirement in ${requirements} ; do
+for requirement in ${requirements[@]} ; do
   python -m pip install ${requirement}
 done
-- 
GitLab