Skip to content

Commit dbedf2c

Browse files
author
Martin D. Weinberg
committed
Add some readthedocs conditionals
1 parent 5105d5c commit dbedf2c

File tree

2 files changed

+35
-18
lines changed

2 files changed

+35
-18
lines changed

conf.py

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
import os, sys
77
import subprocess
88

9+
on_rtd = os.environ.get("READTHEDOCS") == "True"
10+
11+
12+
913
# -- Generate doxygen xml prior to build --------------------------------------
1014

1115
# Define the repository URL and target directory
@@ -42,27 +46,27 @@
4246
#
4347
subprocess.run(["doxygen", doxyfile], check=True)
4448

45-
# Build pyEXP to populate Python API documenation
46-
#
47-
os.chdir('..')
49+
if not on rtd:
50+
# Build pyEXP to populate Python API documenation
51+
#
52+
os.chdir('..')
4853

49-
# Make build directory and begin
50-
#
51-
if not os.path.exists('build'):
52-
subprocess.run(["mkdir", "build"], check=True)
53-
os.chdir('build')
54-
subprocess.run(['cmake', '-DCMAKE_BUILD_TYPE=Release -DENABLE_USER=NO -DENABLE_NBODY=NO -DEigen3_DIR=$EIGEN_BASE/share/eigen3/cmake -Wno-dev', '..'])
55-
subprocess.run(['make', '-j8'])
56-
57-
# Return to top level
58-
#
59-
os.chdir(build_dir)
54+
# Make build directory and begin
55+
#
56+
if not os.path.exists('build'):
57+
subprocess.run(["mkdir", "build"], check=True)
58+
os.chdir('build')
59+
subprocess.run(['cmake', '-DCMAKE_BUILD_TYPE=Release -DENABLE_USER=NO -DENABLE_NBODY=NO -DEigen3_DIR=$EIGEN_BASE/share/eigen3/cmake -Wno-dev', '..'])
60+
subprocess.run(['make', '-j8'])
6061

62+
# Return to top level
63+
#
64+
os.chdir(build_dir)
6165

62-
# Add 'my_module_path' to the beginning of sys.path
63-
#
64-
my_module_path = os.path.join(build_dir, 'exp_repo/build/pyEXP')
65-
sys.path.insert(0, my_module_path)
66+
# Add 'my_module_path' to the beginning of sys.path
67+
#
68+
my_module_path = os.path.join(build_dir, 'exp_repo/build/pyEXP')
69+
sys.path.insert(0, my_module_path)
6670

6771
# Begin Sphinx configuration
6872

@@ -108,6 +112,11 @@
108112
html_logo = 'exp_logo_white.png'
109113
html_static_path = ['_static']
110114

115+
# -- A readthedocs conditional ----------------------------------------------
116+
def setup(app):
117+
if os.environ.get('READTHEDOCS') == 'True':
118+
app.add_tag('rtd')
119+
111120
# -- Turn on figure numering -------------------------------------------------
112121
numfig = True
113122

pybind11.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,11 @@ Index to pyEXP classes
2929
.. automodule:: pyEXP.util
3030
:members:
3131

32+
.. only:: rtd
33+
34+
.. note::
35+
36+
The Python API can not be generated in the _readthedocs_ environment.
37+
You can find these webpages that include the full pyEXP API `on
38+
GitHub Pages
39+
<https://exp-code.github.io/EXP-docs/>`_.

0 commit comments

Comments
 (0)