Skip to content

Commit

Permalink
Missing requirement.txt on RtD
Browse files Browse the repository at this point in the history
build_requirements.py expects requirements.txt to be at the certain
location. Since the documentation is in a subdirectory, it is not where
build_requirements.py would like it to be (missing ./docs)
We build the path of requirements.txt dynamically so it is always in the
same directory than the python script.
  • Loading branch information
jibel committed Jul 5, 2024
1 parent 96788dc commit 379e483
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions docs/.sphinx/build_requirements.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import sys
import os

import pathlib
scriptdir=pathlib.Path(__file__).parent.resolve()
sys.path.append(scriptdir)

sys.path.append('./')
from custom_conf import *

# The file contains helper functions and the mechanism to build the
Expand Down Expand Up @@ -113,7 +117,7 @@ def DeduplicateExtensions(extensionNames: [str]):
requirements = list(dict.fromkeys(requirements))
requirements.sort()

with open(".sphinx/requirements.txt", 'w') as requirements_file:
with open(os.path.join(scriptdir, "requirements.txt"), 'w') as requirements_file:
requirements_file.write(
"# DO NOT MODIFY THIS FILE DIRECTLY!\n"
"#\n"
Expand Down

0 comments on commit 379e483

Please sign in to comment.