Skip to content

Commit

Permalink
Merge branch 'master' into refit-tree-manual
Browse files Browse the repository at this point in the history
  • Loading branch information
shiyu1994 authored Dec 2, 2024
2 parents 13ba538 + 784f384 commit 7cd6152
Show file tree
Hide file tree
Showing 121 changed files with 1,957 additions and 1,092 deletions.
4 changes: 2 additions & 2 deletions .ci/check-python-dists.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ DIST_DIR=${1}
METHOD=${METHOD:-""}
TASK=${TASK:-""}

echo "checking Python package distributions in '${DIST_DIR}'"
echo "checking Python-package distributions in '${DIST_DIR}'"

pip install \
-qq \
Expand Down Expand Up @@ -55,4 +55,4 @@ else
echo "skipping pydistcheck (does not support Python 3.${PY_MINOR_VER})"
fi

echo "done checking Python package distributions"
echo "done checking Python-package distributions"
1 change: 1 addition & 0 deletions .ci/conda-envs/ci-core-py38.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ bokeh=3.1.*
fsspec=2024.5.*
msgpack-python=1.0.*
pluggy=1.5.*
pyparsing=3.1.4
pytz=2024.1
setuptools=69.5.*
snappy=1.2.*
Expand Down
2 changes: 1 addition & 1 deletion .ci/conda-envs/ci-core.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ joblib>=1.3.2
matplotlib-base>=3.7.3
numpy>=1.24.4
pandas>2.0
pyarrow>=6.0
pyarrow-core>=6.0
python-graphviz>=0.20.3
scikit-learn>=1.3.2
scipy>=1.1
Expand Down
40 changes: 23 additions & 17 deletions .ci/install-opencl.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,37 @@ $installer = "AMD-APP-SDKInstaller-v3.0.130.135-GA-windows-F-x64.exe"

Write-Output "Downloading OpenCL platform installer"
$ProgressPreference = "SilentlyContinue" # progress bar bug extremely slows down download speed
Invoke-WebRequest -OutFile "$installer" -Uri "https://github.com/microsoft/LightGBM/releases/download/v2.0.12/$installer"
$params = @{
OutFile = "$installer"
Uri = "https://github.com/microsoft/LightGBM/releases/download/v2.0.12/$installer"
}
Invoke-WebRequest @params

if (Test-Path "$installer") {
Write-Output "Successfully downloaded OpenCL platform installer"
Write-Output "Successfully downloaded OpenCL platform installer"
} else {
Write-Output "Unable to download OpenCL platform installer"
Write-Output "Setting EXIT"
$host.SetShouldExit(-1)
exit 1
Write-Output "Unable to download OpenCL platform installer"
Write-Output "Setting EXIT"
$host.SetShouldExit(-1)
exit 1
}

# Install OpenCL platform from installer executable
Write-Output "Running OpenCL installer"
Invoke-Command -ScriptBlock { Start-Process "$installer" -ArgumentList '/S /V"/quiet /norestart /passive /log opencl.log"' -Wait }
Invoke-Command -ScriptBlock {
Start-Process "$installer" -ArgumentList '/S /V"/quiet /norestart /passive /log opencl.log"' -Wait
}

$property = Get-ItemProperty -Path Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\OpenCL\Vendors
if ($property -eq $null) {
Write-Output "Unable to install OpenCL CPU platform"
Write-Output "OpenCL installation log:"
Get-Content "opencl.log"
Write-Output "Setting EXIT"
$host.SetShouldExit(-1)
exit 1
if ($null -eq $property) {
Write-Output "Unable to install OpenCL CPU platform"
Write-Output "OpenCL installation log:"
Get-Content "opencl.log"
Write-Output "Setting EXIT"
$host.SetShouldExit(-1)
exit 1
} else {
Write-Output "Successfully installed OpenCL CPU platform"
Write-Output "Current OpenCL drivers:"
Write-Output $property
Write-Output "Successfully installed OpenCL CPU platform"
Write-Output "Current OpenCL drivers:"
Write-Output $property
}
5 changes: 5 additions & 0 deletions .ci/lint-js.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

set -e -E -u -o pipefail

biome ci --config-path=./biome.json --diagnostic-level=info --error-on-warnings ./
56 changes: 56 additions & 0 deletions .ci/lint-powershell.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
$settings = @{
Severity = @(
'Information',
'Warning',
'Error'
)
IncludeDefaultRules = $true
# Additional rules that are disabled by default
Rules = @{
PSAvoidExclaimOperator = @{
Enable = $true
}
PSAvoidLongLines = @{
Enable = $true
MaximumLineLength = 120
}
PSAvoidSemicolonsAsLineTerminators = @{
Enable = $true
}
PSPlaceCloseBrace = @{
Enable = $true
NoEmptyLineBefore = $true
IgnoreOneLineBlock = $true
NewLineAfter = $false
}
PSPlaceOpenBrace = @{
Enable = $true
OnSameLine = $true
NewLineAfter = $true
IgnoreOneLineBlock = $true
}
PSUseConsistentIndentation = @{
Enable = $true
IndentationSize = 4
PipelineIndentation = 'IncreaseIndentationAfterEveryPipeline'
Kind = 'space'
}
PSUseConsistentWhitespace = @{
Enable = $true
CheckInnerBrace = $true
CheckOpenBrace = $true
CheckOpenParen = $true
CheckOperator = $true
CheckSeparator = $true
CheckPipe = $true
CheckPipeForRedundantWhitespace = $true
CheckParameter = $true
IgnoreAssignmentOperatorInsideHashTable = $false
}
PSUseCorrectCasing = @{
Enable = $true
}
}
}

Invoke-ScriptAnalyzer -Path ./ -Recurse -EnableExit -Settings $settings
File renamed without changes.
1 change: 0 additions & 1 deletion .ci/lint-r-code.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

loadNamespace("lintr")

args <- commandArgs(
Expand Down
12 changes: 6 additions & 6 deletions .ci/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ if [[ $OS_NAME == "macos" ]]; then
brew install swig
fi
else # Linux
if type -f apt 2>&1 > /dev/null; then
if type -f apt > /dev/null 2>&1; then
sudo apt-get update
sudo apt-get install --no-install-recommends -y \
ca-certificates \
Expand All @@ -42,10 +42,10 @@ else # Linux
fi
CMAKE_VERSION="3.30.0"
curl -O -L \
https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-${ARCH}.sh \
"https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-${ARCH}.sh" \
|| exit 1
sudo mkdir /opt/cmake || exit 1
sudo sh cmake-${CMAKE_VERSION}-linux-${ARCH}.sh --skip-license --prefix=/opt/cmake || exit 1
sudo sh "cmake-${CMAKE_VERSION}-linux-${ARCH}.sh" --skip-license --prefix=/opt/cmake || exit 1
sudo ln -sf /opt/cmake/bin/cmake /usr/local/bin/cmake || exit 1

if [[ $IN_UBUNTU_BASE_CONTAINER == "true" ]]; then
Expand Down Expand Up @@ -142,13 +142,13 @@ else # Linux
fi
fi

if [[ "${TASK}" != "r-package" ]] && [[ "${TASK}" != "r-rchk" ]]; then
if [[ "${TASK}" != "r-package" ]]; then
if [[ $SETUP_CONDA != "false" ]]; then
curl \
-sL \
-o miniforge.sh \
https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-${ARCH}.sh
sh miniforge.sh -b -p $CONDA
"https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-${ARCH}.sh"
sh miniforge.sh -b -p "${CONDA}"
fi
conda config --set always_yes yes --set changeps1 no
conda update -q -y conda
Expand Down
4 changes: 2 additions & 2 deletions .ci/test-python-oldest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pip install \
'numpy==1.19.0' \
'pandas==1.1.3' \
'pyarrow==6.0.1' \
'scikit-learn==0.24.0' \
'scikit-learn==0.24.2' \
'scipy==1.6.0' \
|| exit 1
echo "done installing lightgbm's dependencies"
Expand All @@ -30,7 +30,7 @@ pip freeze
echo ""
echo "checking that examples run without error"

# run a few examples to test that Python package minimally works
# run a few examples to test that Python-package minimally works
echo ""
echo "--- advanced_example.py ---"
echo ""
Expand Down
Loading

0 comments on commit 7cd6152

Please sign in to comment.