Skip to content

Commit

Permalink
Fix setting sys.path when building docs
Browse files Browse the repository at this point in the history
  • Loading branch information
adamreeve committed Sep 11, 2023
1 parent 92d1a74 commit 2146cdc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
# 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
repo_root = Path(__file__).parent.parent
sys.path.insert(0, str(repo_root))

# -- General configuration -----------------------------------------------------

Expand Down Expand Up @@ -52,7 +52,7 @@
# built documents.
#
setup_cfg = configparser.ConfigParser()
setup_cfg.read('../setup.cfg')
setup_cfg.read(repo_root / 'setup.cfg')
# The short X.Y version.
version = '.'.join(setup_cfg['metadata']['version'].split('.')[:2])
# The full version, including alpha/beta/rc tags.
Expand Down

0 comments on commit 2146cdc

Please sign in to comment.