-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[python-package] Add support for NumPy 2.0, test against nightly vers…
- Loading branch information
Showing
7 changed files
with
99 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/bin/bash | ||
|
||
set -e -E -u -o pipefail | ||
|
||
# latest versions of lightgbm's dependencies, | ||
# including pre-releases and nightlies | ||
# | ||
# ref: https://github.com/pydata/xarray/blob/31111b3afe44fd6f7dac363264e94186cc5168d2/.github/workflows/upstream-dev-ci.yaml | ||
echo "installing testing dependencies" | ||
python -m pip install \ | ||
cloudpickle \ | ||
psutil \ | ||
pytest | ||
echo "done installing testing dependencies" | ||
|
||
echo "installing lightgbm's dependencies" | ||
python -m pip install \ | ||
--extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple \ | ||
--prefer-binary \ | ||
--pre \ | ||
--upgrade \ | ||
'numpy>=2.0.0.dev0' \ | ||
'matplotlib>=3.10.0.dev0' \ | ||
'pandas>=3.0.0.dev0' \ | ||
'scikit-learn>=1.6.dev0' \ | ||
'scipy>=1.15.0.dev0' | ||
|
||
python -m pip install \ | ||
--extra-index-url https://pypi.fury.io/arrow-nightlies/ \ | ||
--prefer-binary \ | ||
--pre \ | ||
--upgrade \ | ||
'pyarrow>=17.0.0.dev0' | ||
|
||
python -m pip install \ | ||
'cffi>=1.15.1' | ||
|
||
echo "done installing lightgbm's dependencies" | ||
|
||
echo "installing lightgbm" | ||
pip install --no-deps dist/*.whl | ||
echo "done installing lightgbm" | ||
|
||
echo "installed package versions:" | ||
pip freeze | ||
|
||
echo "" | ||
echo "running tests" | ||
pytest tests/c_api_test/ | ||
pytest tests/python_package_test/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,6 +75,33 @@ jobs: | |
export PATH=${CONDA}/bin:${PATH} | ||
$GITHUB_WORKSPACE/.ci/setup.sh || exit 1 | ||
$GITHUB_WORKSPACE/.ci/test.sh || exit 1 | ||
test-latest-versions: | ||
name: Python - latest versions (ubuntu-latest) | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 5 | ||
submodules: true | ||
- name: Create wheel | ||
run: | | ||
docker run \ | ||
--rm \ | ||
--env CMAKE_BUILD_PARALLEL_LEVEL=${{ env.CMAKE_BUILD_PARALLEL_LEVEL }} \ | ||
-v $(pwd):/opt/lgb-build \ | ||
-w /opt/lgb-build \ | ||
lightgbm/vsts-agent:manylinux_2_28_x86_64 \ | ||
/bin/bash -c 'PATH=/opt/miniforge/bin:$PATH sh ./build-python.sh bdist_wheel --nomp' | ||
- name: Test compatibility | ||
run: | | ||
docker run \ | ||
--rm \ | ||
-v $(pwd):/opt/lgb-build \ | ||
-w /opt/lgb-build \ | ||
python:3.11 \ | ||
/bin/bash ./.ci/test-python-latest.sh | ||
test-oldest-versions: | ||
name: Python - oldest supported versions (ubuntu-latest) | ||
runs-on: ubuntu-latest | ||
|
@@ -89,6 +116,7 @@ jobs: | |
run: | | ||
docker run \ | ||
--rm \ | ||
--env CMAKE_BUILD_PARALLEL_LEVEL=${{ env.CMAKE_BUILD_PARALLEL_LEVEL }} \ | ||
-v $(pwd):/opt/lgb-build \ | ||
-w /opt/lgb-build \ | ||
lightgbm/vsts-agent:manylinux_2_28_x86_64 \ | ||
|
@@ -104,7 +132,7 @@ jobs: | |
all-python-package-jobs-successful: | ||
if: always() | ||
runs-on: ubuntu-latest | ||
needs: [test, test-oldest-versions] | ||
needs: [test, test-latest-versions, test-oldest-versions] | ||
steps: | ||
- name: Note that all tests succeeded | ||
uses: re-actors/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters