From 04a5c151c18d5a762ada2aab0adcc37954a741a5 Mon Sep 17 00:00:00 2001 From: Sumner Evans Date: Sat, 1 Aug 2020 00:48:26 -0600 Subject: [PATCH] Made finding the __init__ file relative to the doc/conf.py file rather than the cwd --- docs/conf.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index c6ddc6a..08351bb 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -18,6 +18,7 @@ import datetime import importlib.util +from pathlib import Path project = "Sublime Music" copyright = f"{datetime.datetime.today().year}, Sumner Evans" @@ -26,7 +27,8 @@ gitlab_url = "https://gitlab.com/sublime-music/sublime-music/" # Get the version from the package. module_name = "sublime" -spec = importlib.util.spec_from_file_location(module_name, "../sublime/__init__.py") +init_file = Path(__file__).parent.parent.joinpath("sublime/__init__.py").resolve() +spec = importlib.util.spec_from_file_location(module_name, str(init_file)) sublime = importlib.util.module_from_spec(spec) spec.loader.exec_module(sublime)