Skip to content

Commit

Permalink
Only load conda environment if required (#2698)
Browse files Browse the repository at this point in the history
The build script for CI is useful to use locally. However, the conda
path does not need to be the same on the local system. As such, we only
source the conda environment in the case that we request it.

Locally, having conda available in PATH will prevent conda from being
sourced again.
  • Loading branch information
keeranroth authored Mar 27, 2024
1 parent 3e833c7 commit b5cd57a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .ci/scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ backend_config=${backend_config:-mkl}
GLOBAL_RETURN=0

if [ "${OS}" == "lnx" ]; then
source /usr/share/miniconda/etc/profile.d/conda.sh
if [ "${conda_env}" != "" ]; then
command -v conda >/dev/null 2>&1 || source /usr/share/miniconda/etc/profile.d/conda.sh
conda activate ${conda_env}
echo "conda '${conda_env}' env activated at ${CONDA_PREFIX}"
fi
Expand All @@ -104,8 +104,8 @@ if [ "${OS}" == "lnx" ]; then
with_gpu="false"
fi
elif [ "${OS}" == "mac" ]; then
source /usr/local/miniconda/etc/profile.d/conda.sh
if [ "${conda_env}" != "" ]; then
command -v conda >/dev/null 2>&1 || source /usr/local/miniconda/etc/profile.d/conda.sh
conda activate ${conda_env}
echo "conda '${conda_env}' env activated at ${CONDA_PREFIX}"
fi
Expand Down

0 comments on commit b5cd57a

Please sign in to comment.