Skip to content

Commit

Permalink
RtD apidoc
Browse files Browse the repository at this point in the history
  • Loading branch information
txemavs committed Mar 28, 2018
1 parent f94d270 commit cb7763c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,12 @@ def run_apidoc():
cur_dir = os.path.abspath(os.path.dirname(__file__))
output_path = os.path.join(cur_dir, 'api')
cmd_path = 'sphinx-apidoc'
if hasattr(sys, 'real_prefix'): # Check to see if we are in a virtualenv
# If we are, assemble the path manually
cmd_path = os.path.abspath(os.path.join(sys.prefix, 'bin', 'sphinx-apidoc'))
if hasattr(sys, 'real_prefix'):
# We are in a virtualenv
d = os.listdir(sys.prefix)
for folder in ['bin', 'Scripts']:
if folder in d:
cmd_path = os.path.abspath(os.path.join(sys.prefix, folder, 'sphinx-apidoc'))
subprocess.check_call([cmd_path, '-e', '-o', output_path, "..", '--force', '--separate'])

run_apidoc()

0 comments on commit cb7763c

Please sign in to comment.