From 7871dda9620e43ac3d101f7c691b7d485a2ff81a Mon Sep 17 00:00:00 2001 From: Adam Reeve Date: Tue, 12 Sep 2023 10:34:12 +1200 Subject: [PATCH] Fix setting sys.path when building docs --- docs/conf.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index dccd495..9a5e5dc 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -11,13 +11,12 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import sys, os +import sys import configparser +from pathlib import Path -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.insert(0, os.path.abspath('..')) +# Allow importing nptdms from the parent directory for building API docs +sys.path.insert(0, str(Path(__file__).parent.parent)) # -- General configuration -----------------------------------------------------