|
3 | 3 | # For the full list of built-in configuration values, see the documentation: |
4 | 4 | # https://www.sphinx-doc.org/en/master/usage/configuration.html |
5 | 5 |
|
6 | | -# -- Generate doxygen xml prior to build -------------------------------------- |
7 | 6 | import os, sys |
8 | 7 | import subprocess |
9 | 8 |
|
| 9 | +# -- Generate doxygen xml prior to build -------------------------------------- |
| 10 | + |
10 | 11 | # Define the repository URL and target directory |
| 12 | +# |
11 | 13 | repo_url = "https://github.com/EXP-code/EXP.git" |
12 | 14 | clone_dir = "exp_repo" |
13 | 15 | branch = "SLboundaries" |
14 | 16 | doxyfile = "exp.cfg.breathe" |
15 | 17 | doxy_dir = "doc" |
16 | 18 |
|
17 | 19 | # Cache the current working directory |
| 20 | +# |
18 | 21 | build_dir = os.getcwd() |
19 | 22 |
|
20 | | -# Clone the repository if it doesn't exist |
| 23 | +# Clone the EXP repository if it doesn't exist |
| 24 | +# |
21 | 25 | if not os.path.exists(clone_dir): |
22 | 26 | subprocess.run(["git", "clone", repo_url, clone_dir], check=True) |
23 | 27 |
|
24 | 28 | # Move to source and get the desired branch |
| 29 | +# |
25 | 30 | os.chdir(clone_dir) |
26 | 31 | subprocess.run(["git", "checkout", branch]) |
27 | 32 | os.chdir(doxy_dir) |
28 | 33 |
|
29 | 34 | # Ensure Doxygen is installed and its executable is in your PATH |
| 35 | +# |
30 | 36 | subprocess.run(["doxygen", doxyfile], check=True) |
31 | 37 |
|
32 | 38 | # Build pyEXP to populate Python API documenation |
| 39 | +# |
33 | 40 | os.chdir('..') |
34 | 41 |
|
35 | 42 | # Workaround for cmake version |
| 43 | +# |
36 | 44 | subprocess.run(['cp', 'CMakeLists.txt', 'CMakeLists.txt.orig']) |
37 | 45 | command_to_pipe = subprocess.Popen(['cat', 'CMakeLists.txt.orig'], stdout=subprocess.PIPE) |
38 | 46 | foutput = open('CMakeLists.txt', 'w') |
39 | 47 | sed_command = subprocess.Popen(['sed', 's/VERSION 3.25/VERSION 3.22/'], stdin=command_to_pipe.stdout, stdout=foutput) |
40 | 48 | foutput.close() |
41 | 49 | command_to_pipe.stdout.close() |
42 | 50 |
|
43 | | -# Make build directory |
| 51 | +# Make build directory and begin |
| 52 | +# |
44 | 53 | if not os.path.exists('build'): |
45 | 54 | subprocess.run(["mkdir", "build"], check=True) |
46 | 55 | os.chdir('build') |
47 | 56 | subprocess.run(['cmake', '-DCMAKE_BUILD_TYPE=Release -DENABLE_USER=NO -DENABLE_NBODY=NO -DEigen3_DIR=$EIGEN_BASE/share/eigen3/cmake -Wno-dev', '..']) |
48 | 57 | subprocess.run(['make', '-j8']) |
49 | 58 |
|
50 | 59 | # Return to top level |
| 60 | +# |
51 | 61 | os.chdir(build_dir) |
52 | 62 |
|
53 | | -my_module_path = os.path.join(build_dir, 'exp_repo/build/pyEXP') |
54 | 63 |
|
55 | 64 | # Add 'my_module_path' to the beginning of sys.path |
| 65 | +# |
| 66 | +my_module_path = os.path.join(build_dir, 'exp_repo/build/pyEXP') |
56 | 67 | sys.path.insert(0, my_module_path) |
57 | 68 |
|
58 | | -# -- Project information ----------------------------------------------------- |
| 69 | +# Begin Sphinx configuration |
| 70 | + |
| 71 | +# -- project information ----------------------------------------------------- |
59 | 72 | # |
60 | 73 | project = 'EXP' |
61 | 74 | copyright = '2023-2025, EXP-code collaboration' |
|
0 commit comments