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

[ci] [python-package] fix missing import, test that lightgbm can be imported...

[ci] [python-package] fix missing import, test that lightgbm can be imported with only required dependencies (fixes #5631) (#5632)
parent 7c1ab96f
...@@ -282,4 +282,15 @@ matplotlib.use\(\"Agg\"\)\ ...@@ -282,4 +282,15 @@ matplotlib.use\(\"Agg\"\)\
cd $BUILD_DIRECTORY/examples/python-guide/notebooks cd $BUILD_DIRECTORY/examples/python-guide/notebooks
sed -i'.bak' 's/INTERACTIVE = False/assert False, \\"Interactive mode disabled\\"/' interactive_plot_example.ipynb sed -i'.bak' 's/INTERACTIVE = False/assert False, \\"Interactive mode disabled\\"/' interactive_plot_example.ipynb
jupyter nbconvert --ExecutePreprocessor.timeout=180 --to notebook --execute --inplace *.ipynb || exit -1 # run all notebooks jupyter nbconvert --ExecutePreprocessor.timeout=180 --to notebook --execute --inplace *.ipynb || exit -1 # run all notebooks
# importing the library should succeed even if all optional dependencies are not present
conda uninstall --force --yes \
dask \
distributed \
joblib \
matplotlib \
psutil \
python-graphviz \
scikit-learn || exit -1
python -c "import lightgbm" || exit -1
fi fi
...@@ -122,6 +122,7 @@ except ImportError: ...@@ -122,6 +122,7 @@ except ImportError:
pass pass
_LGBMBaseCrossValidator = None
_LGBMLabelEncoder = None _LGBMLabelEncoder = None
LGBMNotFittedError = ValueError LGBMNotFittedError = ValueError
_LGBMStratifiedKFold = None _LGBMStratifiedKFold = None
......
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