From 4b09c30c869b1ee8dc879efeab2891583b4ae49d Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Sun, 24 Mar 2024 20:59:48 +0000 Subject: Ensure project root is on sys path before importing the docs module --- docs/conf.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/conf.py b/docs/conf.py index 94246fe4..fb04d245 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -19,6 +19,8 @@ logger = sphinx.util.logging.getLogger(__name__) # Handle the path not being set correctly in actions. sys.path.insert(0, Path("..").resolve()) +PROJECT_ROOT = Path(__file__).parent.parent +sys.path.insert(0, str(PROJECT_ROOT.absolute())) from docs import utils # noqa: E402 @@ -30,9 +32,6 @@ author = "Python Discord" REPO_LINK = "https://github.com/python-discord/bot-core" -PROJECT_ROOT = Path(__file__).parent.parent -sys.path.insert(0, str(PROJECT_ROOT.absolute())) - # The full version, including alpha/beta/rc tags release = version = tomli.loads( (PROJECT_ROOT / "pyproject.toml").read_text(encoding="utf-8") -- cgit v1.2.3