Skip to content

Commit

Permalink
fixed docs import error
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhitingHu committed Aug 30, 2018
1 parent afe5a4f commit 2527c75
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import sys
import os
from recommonmark.parser import CommonMarkParser
from unittest.mock import MagicMock

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
Expand Down Expand Up @@ -334,5 +335,15 @@
None),
}

# Customize
##### Customize ######

autodoc_member_order = 'bysource'

# Adresses import errors. Refer to:
# https://docs.readthedocs.io/en/latest/faq.html#i-get-import-errors-on-libraries-that-depend-on-c-modules
class Mock(MagicMock):
@classmethod
def __getattr__(cls, name):
return MagicMock()
MOCK_MODULES = ['gym']
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)

0 comments on commit 2527c75

Please sign in to comment.