Skip to content

Commit 4b09c30

Browse files
committed
Ensure project root is on sys path before importing the docs module
1 parent edff2a8 commit 4b09c30

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

docs/conf.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919

2020
# Handle the path not being set correctly in actions.
2121
sys.path.insert(0, Path("..").resolve())
22+
PROJECT_ROOT = Path(__file__).parent.parent
23+
sys.path.insert(0, str(PROJECT_ROOT.absolute()))
2224

2325
from docs import utils # noqa: E402
2426

@@ -30,9 +32,6 @@
3032

3133
REPO_LINK = "https://github.com/python-discord/bot-core"
3234

33-
PROJECT_ROOT = Path(__file__).parent.parent
34-
sys.path.insert(0, str(PROJECT_ROOT.absolute()))
35-
3635
# The full version, including alpha/beta/rc tags
3736
release = version = tomli.loads(
3837
(PROJECT_ROOT / "pyproject.toml").read_text(encoding="utf-8")

0 commit comments

Comments
 (0)