Skip to content

Commit d7ee975

Browse files
committed
doc: add path to 'manpages' to conf.py
Problem: sphinx-build cannot find the 'manpages' module which is in the same directory as conf.py. Add the directory to sys.path so it can be loaded.
1 parent 5299547 commit d7ee975

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

doc/Makefile.am

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,6 @@ stderr_devnull_0 = >/dev/null 2>&1
427427

428428
$(MAN_FILES): manpages.py conf.py $(RST_FILES)
429429
$(sphinx_man) \
430-
PYTHONPATH=$(PYTHONPATH):$(abs_srcdir) \
431430
SPHINX_BUILDDIR=$(abs_builddir) $(PYTHON) \
432431
-m sphinx $(sphinx_verbose_flags) -b man $(srcdir) ./man \
433432
$(STDERR_DEVNULL)
@@ -440,7 +439,6 @@ $(MAN_FILES): manpages.py conf.py $(RST_FILES)
440439
.PHONY: html
441440
html: conf.py $(RST_FILES)
442441
$(sphinx_html) \
443-
PYTHONPATH=$(PYTHONPATH):$(abs_srcdir) \
444442
SPHINX_BUILDDIR=$(abs_builddir) $(PYTHON) \
445443
-m sphinx $(sphinx_verbose_flags) -b html $(srcdir) ./html \
446444
$(STDERR_DEVNULL)

doc/conf.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@
2222
#
2323
import os
2424
import sys
25+
26+
# add `manpages` directory to sys.path
27+
import pathlib
28+
sys.path.append(str(pathlib.Path(__file__).absolute().parent))
29+
2530
from manpages import man_pages
2631
import docutils.nodes
2732

0 commit comments

Comments
 (0)