Unverified Commit d9c7c72a authored by James Lamb's avatar James Lamb Committed by GitHub
Browse files

[ci] [python-package] Add CI job testing compatibility with oldest possible versions (#5936)

parent 32bd71e7
#!/bin/bash
# oldest versions of dependencies published after
# minimum supported Python version's first release
#
# see https://devguide.python.org/versions/
#
echo "installing lightgbm's dependencies"
pip install \
'numpy==1.12.0' \
'pandas==0.24.0' \
'scikit-learn==0.18.2' \
'scipy==0.19.0' \
|| exit -1
echo "done installing lightgbm's dependencies"
echo "installing lightgbm"
pip install --no-deps dist/*.whl || exit -1
echo "done installing lightgbm"
echo "installed package versions:"
pip freeze
echo ""
echo "checking that examples run without error"
# run a few examples to test that Python package minimally works
echo ""
echo "--- advanced_example.py ---"
echo ""
python ./examples/python-guide/advanced_example.py || exit -1
echo ""
echo "--- logistic_regression.py ---"
echo ""
python ./examples/python-guide/logistic_regression.py || exit -1
echo ""
echo "--- simple_example.py ---"
echo ""
python ./examples/python-guide/simple_example.py || exit -1
echo ""
echo "--- sklearn_example.py ---"
echo ""
python ./examples/python-guide/sklearn_example.py || exit -1
echo ""
echo "done testing on oldest supported Python version"
...@@ -76,10 +76,36 @@ jobs: ...@@ -76,10 +76,36 @@ jobs:
export PATH=${CONDA}/bin:${PATH} export PATH=${CONDA}/bin:${PATH}
$GITHUB_WORKSPACE/.ci/setup.sh || exit -1 $GITHUB_WORKSPACE/.ci/setup.sh || exit -1
$GITHUB_WORKSPACE/.ci/test.sh || exit -1 $GITHUB_WORKSPACE/.ci/test.sh || exit -1
test-oldest-versions:
name: Python - oldest supported versions (ubuntu-latest)
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 5
submodules: true
- name: Create wheel
run: |
docker run \
--rm \
-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.6 \
/bin/bash ./.ci/test-python-oldest.sh
all-python-package-jobs-successful: all-python-package-jobs-successful:
if: always() if: always()
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [test] needs: [test, test-oldest-versions]
steps: steps:
- name: Note that all tests succeeded - name: Note that all tests succeeded
uses: re-actors/alls-green@v1.2.2 uses: re-actors/alls-green@v1.2.2
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment