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

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

5
6
7
8
9
10
11
# 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 \
12
  'cffi==1.15.1' \
13
  'dataclasses' \
14
  'numpy==1.16.6' \
15
  'pandas==0.24.0' \
16
  'pyarrow==6.0.1' \
17
18
  'scikit-learn==0.18.2' \
  'scipy==0.19.0' \
19
|| exit 1
20
21
22
echo "done installing lightgbm's dependencies"

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

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

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

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

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