Skip to content

Commit

Permalink
docs: more trial and error on rtd [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
swistakm committed Nov 17, 2016
1 parent 8f78fc9 commit baa4ec0
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
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

Expand All @@ -39,7 +42,7 @@ def __getattr__(cls, name):
MOCK_MODULES = ['glfw']
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)

sys.path.insert(0, os.path.dirname(__file__))
sys.path.insert(0, CONF_DIR)


# this is quite dirty approach but we're not working at NASA and nobody can die
Expand Down Expand Up @@ -68,6 +71,8 @@ def skip(app, what, name, obj, skip, options):
def setup(app):
app.connect("autodoc-skip-member", skip)

sys.path.insert(0, PROJECT_ROOT_DIR)

else:
render_examples = True

Expand All @@ -78,9 +83,7 @@ def get_version(version_tuple):
return '.'.join(map(str, version_tuple))


init = os.path.join(
os.path.dirname(os.path.dirname(os.path.dirname(__file__))),
'imgui', '__init__.py')
init = os.path.join(PROJECT_ROOT_DIR, 'imgui', '__init__.py')
version_line = list(filter(lambda l: l.startswith('VERSION'), open(init)))[0]

VERSION = get_version(eval(version_line.split('=')[-1]))
Expand Down

0 comments on commit baa4ec0

Please sign in to comment.