diff --git a/.ci/test.sh b/.ci/test.sh index 34949cfc2334..4b01e7c241af 100755 --- a/.ci/test.sh +++ b/.ci/test.sh @@ -93,14 +93,9 @@ if [[ $TASK == "lint" ]]; then exit 0 fi -conda create -q -y -n $CONDA_ENV "${CONDA_PYTHON_REQUIREMENT}" -source activate $CONDA_ENV - -cd $BUILD_DIRECTORY - if [[ $TASK == "check-docs" ]] || [[ $TASK == "check-links" ]]; then cd $BUILD_DIRECTORY/docs - conda env update \ + conda env create \ -n $CONDA_ENV \ --file ./env.yml || exit -1 conda install \ @@ -109,6 +104,7 @@ if [[ $TASK == "check-docs" ]] || [[ $TASK == "check-links" ]]; then -n $CONDA_ENV \ doxygen \ 'rstcheck>=6.0.0' || exit -1 + source activate $CONDA_ENV # check reStructuredText formatting cd $BUILD_DIRECTORY/python-package rstcheck --report-level warning $(find . -type f -name "*.rst") || exit -1 @@ -131,8 +127,8 @@ if [[ $TASK == "check-docs" ]] || [[ $TASK == "check-links" ]]; then exit 0 fi -# re-including python=version[build=*cpython] to ensure that conda doesn't fall back to pypy -conda install -q -y -n $CONDA_ENV \ +# including python=version[build=*cpython] to ensure that conda doesn't fall back to pypy +conda create -q -y -n $CONDA_ENV \ cloudpickle \ dask-core \ distributed \ @@ -147,6 +143,10 @@ conda install -q -y -n $CONDA_ENV \ scikit-learn \ scipy || exit -1 +source activate $CONDA_ENV + +cd $BUILD_DIRECTORY + 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