Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tianlh
LightGBM-DCU
Commits
d9c7c72a
Unverified
Commit
d9c7c72a
authored
Jul 05, 2023
by
James Lamb
Committed by
GitHub
Jul 05, 2023
Browse files
[ci] [python-package] Add CI job testing compatibility with oldest possible versions (#5936)
parent
32bd71e7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
1 deletion
+76
-1
.ci/test-python-oldest.sh
.ci/test-python-oldest.sh
+49
-0
.github/workflows/python_package.yml
.github/workflows/python_package.yml
+27
-1
No files found.
.ci/test-python-oldest.sh
0 → 100644
View file @
d9c7c72a
#!/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"
.github/workflows/python_package.yml
View file @
d9c7c72a
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment