From 336aa0a428180804b572695196a54dc7eb7e1669 Mon Sep 17 00:00:00 2001 From: Kyle Benesch <4b796c65+github@gmail.com> Date: Tue, 20 Feb 2024 09:37:34 -0800 Subject: [PATCH] conf.py should always open files relative to script Fixes tests importing this script from other places --- docs/conf.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index a323f906..f66b990d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -25,6 +25,8 @@ sys.path.insert(0, str(Path("..").resolve(strict=True))) +THIS_DIR = Path(__file__).parent + # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. @@ -378,8 +380,8 @@ napoleon_use_param = True napoleon_use_rtype = True -rst_prolog = Path("prolog.rst").read_text(encoding="utf-8") # Added to the beginning of every source file. -rst_epilog = Path("epilog.rst").read_text(encoding="utf-8") # Added to the end of every source file. +rst_prolog = (THIS_DIR / "prolog.rst").read_text(encoding="utf-8") # Added to the beginning of every source file. +rst_epilog = (THIS_DIR / "epilog.rst").read_text(encoding="utf-8") # Added to the end of every source file. # Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = {