Skip to content

Commit d8318d0

Browse files
StrikerRUSjameslamb
authored andcommitted
[ci] prefer CPython in Linux and macOS test environment (#5555)
1 parent b8da45d commit d8318d0

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

.ci/test.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ if [[ "$TASK" == "cpp-tests" ]]; then
2929
exit 0
3030
fi
3131

32-
conda create -q -y -n $CONDA_ENV python=$PYTHON_VERSION
32+
conda create -q -y -n $CONDA_ENV "python=$PYTHON_VERSION[build=*cpython]"
3333
source activate $CONDA_ENV
3434

3535
cd $BUILD_DIRECTORY
@@ -125,6 +125,7 @@ else
125125
DEPENDENCIES="dask=2022.7.0 distributed=2022.7.0 scipy<1.9"
126126
fi
127127

128+
# re-including python=version[build=*cpython] to ensure that conda doesn't fall back to pypy
128129
conda install -q -y -n $CONDA_ENV \
129130
cloudpickle \
130131
${DEPENDENCIES} \
@@ -134,12 +135,10 @@ conda install -q -y -n $CONDA_ENV \
134135
pandas \
135136
psutil \
136137
pytest \
138+
"python=$PYTHON_VERSION[build=*cpython]" \
139+
python-graphviz \
137140
scikit-learn || exit -1
138141

139-
# python-graphviz has to be installed separately to prevent conda from downgrading to pypy
140-
conda install -q -y -n $CONDA_ENV \
141-
python-graphviz || exit -1
142-
143142
if [[ $OS_NAME == "macos" ]] && [[ $COMPILER == "clang" ]]; then
144143
# fix "OMP: Error #15: Initializing libiomp5.dylib, but found libomp.dylib already initialized." (OpenMP library conflict due to conda's MKL)
145144
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

0 commit comments

Comments
 (0)