@@ -46,6 +46,7 @@ if [[ "$TASK" == "cpp-tests" ]]; then
46
46
exit 0
47
47
fi
48
48
49
+ # including python=version[build=*cpython] to ensure that conda doesn't fall back to pypy
49
50
CONDA_PYTHON_REQUIREMENT=" python=$PYTHON_VERSION [build=*cpython]"
50
51
51
52
if [[ $TASK == " if-else" ]]; then
@@ -78,10 +79,10 @@ if [[ $TASK == "lint" ]]; then
78
79
${CONDA_PYTHON_REQUIREMENT} \
79
80
' cmakelint>=1.4.2' \
80
81
' cpplint>=1.6.0' \
81
- ' matplotlib>=3.8.3' \
82
+ ' matplotlib-base >=3.8.3' \
82
83
' mypy>=1.8.0' \
83
84
' pre-commit>=3.6.0' \
84
- ' pyarrow>=14 .0' \
85
+ ' pyarrow>=6 .0' \
85
86
' r-lintr>=3.1'
86
87
source activate $CONDA_ENV
87
88
echo " Linting Python code"
@@ -127,28 +128,18 @@ if [[ $TASK == "check-docs" ]] || [[ $TASK == "check-links" ]]; then
127
128
exit 0
128
129
fi
129
130
130
- # older versions of Dask are incompatible with pandas>=2.0, but not all conda packages' metadata accurately reflects that
131
- #
132
- # ref: https://github.com/microsoft/LightGBM/issues/6030
133
- CONSTRAINED_DEPENDENCIES=" 'dask>=2023.5.0' 'distributed>=2023.5.0' 'pandas>=2.0' python-graphviz"
134
131
if [[ $PYTHON_VERSION == " 3.7" ]]; then
135
- CONSTRAINED_DEPENDENCIES=" 'dask' 'distributed' 'python-graphviz<0.20.2' 'pandas<2.0'"
132
+ CONDA_REQUIREMENT_FILES=" --file ${BUILD_DIRECTORY} /.ci/conda-envs/ci-core-py37.txt"
133
+ else
134
+ CONDA_REQUIREMENT_FILES=" --file ${BUILD_DIRECTORY} /.ci/conda-envs/ci-core.txt"
136
135
fi
137
136
138
- # including python=version[build=*cpython] to ensure that conda doesn't fall back to pypy
139
- mamba create -q -y -n $CONDA_ENV \
140
- ${CONSTRAINED_DEPENDENCIES} \
141
- cffi \
142
- cloudpickle \
143
- joblib \
144
- matplotlib \
145
- numpy \
146
- psutil \
147
- pyarrow \
148
- pytest \
137
+ mamba create \
138
+ -y \
139
+ -n $CONDA_ENV \
140
+ ${CONDA_REQUIREMENT_FILES} \
149
141
${CONDA_PYTHON_REQUIREMENT} \
150
- scikit-learn \
151
- scipy || exit 1
142
+ || exit 1
152
143
153
144
source activate $CONDA_ENV
154
145
@@ -310,10 +301,10 @@ matplotlib.use\(\"Agg\"\)\
310
301
' plot_example.py # prevent interactive window mode
311
302
sed -i' .bak' ' s/graph.render(view=True)/graph.render(view=False)/' plot_example.py
312
303
# requirements for examples
313
- mamba install -q - y -n $CONDA_ENV \
314
- h5py \
315
- ipywidgets \
316
- notebook
304
+ mamba install -y -n $CONDA_ENV \
305
+ ' h5py>=3.10 ' \
306
+ ' ipywidgets>=8.1.2 ' \
307
+ ' notebook>=7.1.2 '
317
308
for f in * .py ** /* .py; do python $f || exit 1; done # run all examples
318
309
cd $BUILD_DIRECTORY /examples/python-guide/notebooks
319
310
sed -i' .bak' ' s/INTERACTIVE = False/assert False, \\"Interactive mode disabled\\"/' interactive_plot_example.ipynb
@@ -325,7 +316,7 @@ matplotlib.use\(\"Agg\"\)\
325
316
dask \
326
317
distributed \
327
318
joblib \
328
- matplotlib \
319
+ matplotlib-base \
329
320
psutil \
330
321
pyarrow \
331
322
python-graphviz \
0 commit comments