From 6d0e85492d9ffe9aedcfdd78a36f48726f1e1ec6 Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 27 Feb 2021 13:48:11 +0100 Subject: [PATCH] Fix doc conf build for multiversion --- docs/source/conf.py | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 73d163daf9..98c568e4ec 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -176,28 +176,17 @@ ansi_clean = None if not _no_autodoc: # we must set up Evennia and its paths for autodocs to work - EV_ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) # os.environ.get("EVDIR") - GAME_DIR = os.environ.get("EVGAMEDIR") + EV_ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) - if not (EV_ROOT and GAME_DIR): - err = ( - "The EVDIR and EVGAMEDIR environment variables must be set to " - "the absolute paths to the evennia/ repo and an initialized " - "evennia gamedir respectively." - ) - raise RuntimeError(err) - - print("Evennia root: {}, Game dir: {}, branch:".format(EV_ROOT, GAME_DIR)), import subprocess subprocess.call(["git", "rev-parse", "--abbrev-ref", "HEAD"]) subprocess.call("pwd") sys.path.insert(1, EV_ROOT) - sys.path.insert(1, GAME_DIR) - with cd(GAME_DIR): + with cd(EV_ROOT): # set up Evennia so its sources can be parsed - os.environ["DJANGO_SETTINGS_MODULE"] = "server.conf.settings" + os.environ["DJANGO_SETTINGS_MODULE"] = "evennia.settings.default" import django # noqa