bumpver/scripts/setup_conda_envs.sh

28 lines
913 B
Bash
Raw Normal View History

2018-11-04 21:34:53 +01:00
#!/bin/bash
read -r -a env_names <<< "${CONDA_ENV_NAMES//, /$IFS}";
2019-02-15 19:57:18 +01:00
read -r -a env_py_paths <<< "${CONDA_ENV_BIN_PYTHON_PATHS//, /$IFS}";
2018-11-04 21:34:53 +01:00
read -r -a py_versions <<< "${SUPPORTED_PYTHON_VERSIONS//, /$IFS}";
2019-02-15 19:57:18 +01:00
for i in ${!env_py_paths[@]}; do
env_path_python=${env_py_paths[i]};
2018-11-04 21:34:53 +01:00
env_name=${env_names[i]};
py_version=${py_versions[i]};
if [[ ! -f ${env_path_python} ]]; then
echo "conda create --name ${env_name} ${py_version} ...";
2018-12-06 18:21:22 +01:00
${CONDA_BIN} create --name ${env_name} --channel conda-forge ${py_version} --yes --quiet;
2018-11-04 21:34:53 +01:00
fi;
echo "updating ${env_name} conda deps ...";
${CONDA_BIN} install --name ${env_name} --channel conda-forge --yes --quiet \
$(grep -o '^[^#][^ ]*' requirements/conda.txt)
2019-02-15 19:57:18 +01:00
${env_path_python} -m ensurepip;
2018-11-04 21:34:53 +01:00
${env_path_python} --version >> build/envs.txt.tmp \
2>>build/envs.txt.tmp \
1>>build/envs.txt.tmp;
done;