Skip to content

Commit

Permalink
docs: do final cleanup after fixing rtd issue (fixes #3) [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
swistakm committed Nov 17, 2016
1 parent 8657358 commit 6d8ef1a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 46 deletions.
49 changes: 9 additions & 40 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,31 +19,11 @@
import os
import sys

CONF_DIR = os.path.dirname(os.path.abspath(__file__))
PROJECT_ROOT_DIR = os.path.dirname(os.path.dirname(CONF_DIR))

try:
import glfw

except ImportError:
glfw = None

if glfw is None:
try:
from unittest.mock import MagicMock
except ImportError:
from mock import MagicMock

class Mock(MagicMock):
@classmethod
def __getattr__(cls, name):
return Mock()

MOCK_MODULES = ['glfw']
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)

sys.path.insert(0, CONF_DIR)
DOC_SOURCES_DIR = os.path.dirname(os.path.abspath(__file__))
PROJECT_ROOT_DIR = os.path.dirname(os.path.dirname(DOC_SOURCES_DIR))

# insert
sys.path.insert(0, DOC_SOURCES_DIR)

# this is quite dirty approach but we're not working at NASA and nobody can die
# because of that. Am I right?
Expand All @@ -58,21 +38,6 @@ def __getattr__(cls, name):
from git_lfs import fetch
fetch(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))

def skip(app, what, name, obj, skip, options):
if what == "module":
print(what, name, obj, skip, options)

# if 'members' in options:
# import ipdb; ipdb.set_trace()
#
# exit()
return skip

def setup(app):
app.connect("autodoc-skip-member", skip)

sys.path.append(PROJECT_ROOT_DIR)

else:
render_examples = True

Expand Down Expand Up @@ -215,7 +180,7 @@ def get_version(version_tuple):

html_theme_options = {
'github_user': 'swistakm',
'github_repo': 'imgui',
'github_repo': 'pyimgui',
'github_button': True,
'github_type': 'star',
'sidebar_includehidden': True,
Expand Down Expand Up @@ -455,3 +420,7 @@ def get_version(version_tuple):
napoleon_use_ivar = False
napoleon_use_param = False
napoleon_use_rtype = False

autodoc_member_order = 'bysource'
# this is in order to support GlfwImpl documentation on RTD
autodoc_mock_imports = ['glfw']
6 changes: 0 additions & 6 deletions imgui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,3 @@
#: Ensure child windows without border uses style.WindowPadding (ignored by
#: default for non-bordered child windows, because more convenient)
WINDOW_ALWAYS_USE_WINDOW_PADDING = core.WINDOW_ALWAYS_USE_WINDOW_PADDING

#: to test attrib doc as comment
FOO = 1

BAR = 2
"""To test attrib doc as string"""

0 comments on commit 6d8ef1a

Please sign in to comment.