Skip to content

Commit 336aa0a

Browse files
committed
conf.py should always open files relative to script
Fixes tests importing this script from other places
1 parent 63e98d9 commit 336aa0a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

docs/conf.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525

2626
sys.path.insert(0, str(Path("..").resolve(strict=True)))
2727

28+
THIS_DIR = Path(__file__).parent
29+
2830
# -- General configuration ------------------------------------------------
2931

3032
# If your documentation needs a minimal Sphinx version, state it here.
@@ -378,8 +380,8 @@
378380
napoleon_use_param = True
379381
napoleon_use_rtype = True
380382

381-
rst_prolog = Path("prolog.rst").read_text(encoding="utf-8") # Added to the beginning of every source file.
382-
rst_epilog = Path("epilog.rst").read_text(encoding="utf-8") # Added to the end of every source file.
383+
rst_prolog = (THIS_DIR / "prolog.rst").read_text(encoding="utf-8") # Added to the beginning of every source file.
384+
rst_epilog = (THIS_DIR / "epilog.rst").read_text(encoding="utf-8") # Added to the end of every source file.
383385

384386
# Example configuration for intersphinx: refer to the Python standard library.
385387
intersphinx_mapping = {

0 commit comments

Comments
 (0)