test-python-oldest.sh 1.26 KB
Newer Older
1
2
#!/bin/bash

3
4
set -e -E -u -o pipefail

5
# oldest versions of dependencies published after
6
7
8
# minimum supported Python version's first release,
# for which there are wheels compatible with the
# python:{version} image
9
10
11
12
13
#
# see https://devguide.python.org/versions/
#
echo "installing lightgbm's dependencies"
pip install \
14
  'cffi==1.15.1' \
15
16
  'numpy==1.19.0' \
  'pandas==1.1.3' \
17
  'pyarrow==6.0.1' \
18
19
  'scikit-learn==0.24.0' \
  'scipy==1.6.0' \
20
|| exit 1
21
22
23
echo "done installing lightgbm's dependencies"

echo "installing lightgbm"
24
pip install --no-deps dist/*.whl || exit 1
25
26
27
28
29
30
31
32
33
34
35
36
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 ""
37
python ./examples/python-guide/advanced_example.py || exit 1
38
39
40
41

echo ""
echo "--- logistic_regression.py ---"
echo ""
42
python ./examples/python-guide/logistic_regression.py || exit 1
43
44
45
46

echo ""
echo "--- simple_example.py ---"
echo ""
47
python ./examples/python-guide/simple_example.py || exit 1
48
49
50
51

echo ""
echo "--- sklearn_example.py ---"
echo ""
52
python ./examples/python-guide/sklearn_example.py || exit 1
53
54
55

echo ""
echo "done testing on oldest supported Python version"