From 9a84b61d93dec3c7a0a7e8cd2ee60a35de693de1 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Thu, 20 Jul 2023 15:25:12 -0500 Subject: [PATCH] [ci] use newer h5py in AppVeyor jobs (fixes #5995) (#5996) --- .ci/test_windows.ps1 | 2 +- R-package/tests/testthat/test_dataset.R | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/test_windows.ps1 b/.ci/test_windows.ps1 index 5962a9441346..413af821e065 100644 --- a/.ci/test_windows.ps1 +++ b/.ci/test_windows.ps1 @@ -124,7 +124,7 @@ if (($env:TASK -eq "regular") -or (($env:APPVEYOR -eq "true") -and ($env:TASK -e cd $env:BUILD_SOURCESDIRECTORY/examples/python-guide @("import matplotlib", "matplotlib.use('Agg')") + (Get-Content "plot_example.py") | Set-Content "plot_example.py" (Get-Content "plot_example.py").replace('graph.render(view=True)', 'graph.render(view=False)') | Set-Content "plot_example.py" # prevent interactive window mode - conda install -q -y -n $env:CONDA_ENV h5py ipywidgets notebook + conda install -q -y -n $env:CONDA_ENV "h5py>3.0" ipywidgets notebook foreach ($file in @(Get-ChildItem *.py)) { @("import sys, warnings", "warnings.showwarning = lambda message, category, filename, lineno, file=None, line=None: sys.stdout.write(warnings.formatwarning(message, category, filename, lineno, line))") + (Get-Content $file) | Set-Content $file python $file ; Check-Output $? diff --git a/R-package/tests/testthat/test_dataset.R b/R-package/tests/testthat/test_dataset.R index e7fbe692febe..7ea95655cca2 100644 --- a/R-package/tests/testthat/test_dataset.R +++ b/R-package/tests/testthat/test_dataset.R @@ -446,7 +446,7 @@ test_that("lgb.Dataset: should be able to use and retrieve long feature names", # set one feature to a value longer than the default buffer size used # in LGBM_DatasetGetFeatureNames_R feature_names <- names(iris) - long_name <- paste0(rep("a", 1000L), collapse = "") + long_name <- strrep("a", 1000L) feature_names[1L] <- long_name names(iris) <- feature_names # check that feature name survived the trip from R to C++ and back