diff --git a/.ci/test.sh b/.ci/test.sh index c75cf33d8565..6439f4c660fd 100755 --- a/.ci/test.sh +++ b/.ci/test.sh @@ -29,7 +29,7 @@ if [[ "$TASK" == "cpp-tests" ]]; then exit 0 fi -conda create -q -y -n $CONDA_ENV python=$PYTHON_VERSION +conda create -q -y -n $CONDA_ENV "python=$PYTHON_VERSION[build=*cpython]" source activate $CONDA_ENV cd $BUILD_DIRECTORY @@ -125,6 +125,7 @@ else DEPENDENCIES="dask=2022.7.0 distributed=2022.7.0 scipy<1.9" fi +# re-including python=version[build=*cpython] to ensure that conda doesn't fall back to pypy conda install -q -y -n $CONDA_ENV \ cloudpickle \ ${DEPENDENCIES} \ @@ -134,12 +135,10 @@ conda install -q -y -n $CONDA_ENV \ pandas \ psutil \ pytest \ + "python=$PYTHON_VERSION[build=*cpython]" \ + python-graphviz \ scikit-learn || exit -1 -# python-graphviz has to be installed separately to prevent conda from downgrading to pypy -conda install -q -y -n $CONDA_ENV \ - python-graphviz || exit -1 - if [[ $OS_NAME == "macos" ]] && [[ $COMPILER == "clang" ]]; then # fix "OMP: Error #15: Initializing libiomp5.dylib, but found libomp.dylib already initialized." (OpenMP library conflict due to conda's MKL) for LIBOMP_ALIAS in libgomp.dylib libiomp5.dylib libomp.dylib; do sudo ln -sf "$(brew --cellar libomp)"/*/lib/libomp.dylib $CONDA_PREFIX/lib/$LIBOMP_ALIAS || exit -1; done