From debd3b2e78b60162831437d9ad6a09fb442b30ab Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sun, 20 Nov 2022 23:50:30 -0600 Subject: [PATCH 1/4] [ci] remove constraints on dask and scipy in CI (fixes #5390) --- .ci/test.sh | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.ci/test.sh b/.ci/test.sh index 6439f4c660fd..bed16aeb17d4 100755 --- a/.ci/test.sh +++ b/.ci/test.sh @@ -118,17 +118,11 @@ if [[ $TASK == "swig" ]]; then exit 0 fi -# temporary fix for https://github.com/microsoft/LightGBM/issues/5390 -if [[ $PYTHON_VERSION == "3.7" ]]; then - DEPENDENCIES="dask distributed" -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} \ + dask-core \ + distributed \ joblib \ matplotlib \ numpy \ From b9cfbfd96a755a70fcc7d1066bdf744165d66340 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Sun, 20 Nov 2022 23:57:12 -0600 Subject: [PATCH 2/4] add scipy --- .ci/test.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.ci/test.sh b/.ci/test.sh index bed16aeb17d4..a69890fe3178 100755 --- a/.ci/test.sh +++ b/.ci/test.sh @@ -131,7 +131,8 @@ conda install -q -y -n $CONDA_ENV \ pytest \ "python=$PYTHON_VERSION[build=*cpython]" \ python-graphviz \ - scikit-learn || exit -1 + scikit-learn \ + scipy || 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) From c5b3fec701e650ffc9e0a89bf5c560efed561f88 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Tue, 22 Nov 2022 00:37:25 -0600 Subject: [PATCH 3/4] set small timeout on restart --- tests/python_package_test/test_dask.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/python_package_test/test_dask.py b/tests/python_package_test/test_dask.py index 86bc064e0829..d352b830c76a 100644 --- a/tests/python_package_test/test_dask.py +++ b/tests/python_package_test/test_dask.py @@ -1650,7 +1650,7 @@ def test_machines_should_be_used_if_provided(task, cluster): dask_model.fit(dX, dy, group=dg) # The above error leaves a worker waiting - client.restart() + client.restart(timeout=5) # an informative error should be raised if "machines" has duplicates one_open_port = lgb.dask._find_n_open_ports(1) From e558602119858136f4d234a925664be438c33cc6 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Tue, 22 Nov 2022 00:38:52 -0600 Subject: [PATCH 4/4] set timeout on client.restart() --- tests/python_package_test/test_dask.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/python_package_test/test_dask.py b/tests/python_package_test/test_dask.py index d352b830c76a..5dbbf7a29761 100644 --- a/tests/python_package_test/test_dask.py +++ b/tests/python_package_test/test_dask.py @@ -1650,7 +1650,7 @@ def test_machines_should_be_used_if_provided(task, cluster): dask_model.fit(dX, dy, group=dg) # The above error leaves a worker waiting - client.restart(timeout=5) + client.restart(timeout=5, wait_for_workers=True) # an informative error should be raised if "machines" has duplicates one_open_port = lgb.dask._find_n_open_ports(1)