From a9bf08c5e6bd2d5fca76f6ca8b4bfc15a5415139 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sat, 25 Feb 2023 17:13:52 -0600 Subject: [PATCH 1/3] [ci] speed up conda setup for macOS and Linux jobs --- .ci/test.sh | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.ci/test.sh b/.ci/test.sh index 34949cfc2334..6bcf5d56899b 100755 --- a/.ci/test.sh +++ b/.ci/test.sh @@ -93,11 +93,6 @@ 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 \ @@ -131,8 +126,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 +142,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 From 8534da6d21323e180f34fa2f73b390c4d83d9274 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sat, 25 Feb 2023 17:15:01 -0600 Subject: [PATCH 2/3] fix docs build --- .ci/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/test.sh b/.ci/test.sh index 6bcf5d56899b..ca83e068f2c9 100755 --- a/.ci/test.sh +++ b/.ci/test.sh @@ -95,7 +95,7 @@ fi 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 \ From a00aaf533acff517eb59727c3b3cd7ac9e6e54b5 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sat, 25 Feb 2023 17:34:12 -0600 Subject: [PATCH 3/3] add missing 'source activate' in check-docs --- .ci/test.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.ci/test.sh b/.ci/test.sh index ca83e068f2c9..4b01e7c241af 100755 --- a/.ci/test.sh +++ b/.ci/test.sh @@ -104,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