|
6 | 6 | import os, sys |
7 | 7 | import subprocess |
8 | 8 |
|
| 9 | +on_rtd = os.environ.get("READTHEDOCS") == "True" |
| 10 | + |
| 11 | + |
| 12 | + |
9 | 13 | # -- Generate doxygen xml prior to build -------------------------------------- |
10 | 14 |
|
11 | 15 | # Define the repository URL and target directory |
|
42 | 46 | # |
43 | 47 | subprocess.run(["doxygen", doxyfile], check=True) |
44 | 48 |
|
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('..') |
48 | 53 |
|
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']) |
60 | 61 |
|
| 62 | + # Return to top level |
| 63 | + # |
| 64 | + os.chdir(build_dir) |
61 | 65 |
|
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) |
66 | 70 |
|
67 | 71 | # Begin Sphinx configuration |
68 | 72 |
|
|
108 | 112 | html_logo = 'exp_logo_white.png' |
109 | 113 | html_static_path = ['_static'] |
110 | 114 |
|
| 115 | +# -- A readthedocs conditional ---------------------------------------------- |
| 116 | +def setup(app): |
| 117 | + if os.environ.get('READTHEDOCS') == 'True': |
| 118 | + app.add_tag('rtd') |
| 119 | + |
111 | 120 | # -- Turn on figure numering ------------------------------------------------- |
112 | 121 | numfig = True |
113 | 122 |
|
|
0 commit comments