Skip to content

Commit

Permalink
docs: fix build error by mocking LGBMDeprecated (#494)
Browse files Browse the repository at this point in the history
If scikit-learn isn't installed (and Read the Docs doesn't have it),
LGBMDeprecated aren't created and can't be imported.
  • Loading branch information
henry0312 authored and guolinke committed May 5, 2017
1 parent c9fb514 commit b54f60f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@

# -- mock out modules
from unittest.mock import Mock
MOCK_MODULES = ['numpy', 'scipy', 'scipy.sparse', 'sklearn', 'matplotlib', 'pandas', 'graphviz']
MOCK_MODULES = [
'numpy', 'scipy', 'scipy.sparse',
'sklearn', 'matplotlib', 'pandas', 'graphviz',
'lightgbm.compat.LGBMDeprecated'
]
for mod_name in MOCK_MODULES:
sys.modules[mod_name] = Mock()

Expand Down

0 comments on commit b54f60f

Please sign in to comment.