]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
doc: Use sys.path.append for pytests being found
authorTom Rini <trini@konsulko.com>
Mon, 9 Mar 2026 18:09:52 +0000 (12:09 -0600)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Fri, 27 Mar 2026 09:53:28 +0000 (10:53 +0100)
Rather than having our "docs" build tagets modify PTYHONPATH, have
doc/conf.py append the required paths at runtime instead. This will
ensure that our builds from readthedocs will also find all of the
required files.

Signed-off-by: Tom Rini <trini@konsulko.com>
Makefile
doc/conf.py

index c175af95aca82e64608bd28cbdf03cacad7bf6de..f232d8b4ea23cf5f277211fc9c875568a56206e0 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2759,8 +2759,7 @@ DOC_TARGETS := xmldocs latexdocs pdfdocs htmldocs epubdocs cleandocs \
               linkcheckdocs dochelp refcheckdocs texinfodocs infodocs
 PHONY += $(DOC_TARGETS)
 $(DOC_TARGETS): scripts_basic FORCE
-       $(Q)PYTHONPATH=$(srctree)/test/py/tests:$(srctree)/test/py \
-       $(MAKE) $(build)=doc $@
+       $(Q)$(MAKE) $(build)=doc $@
 
 PHONY += checkstack ubootrelease ubootversion
 
index 84d028feda83d49eb2cc18460d04498997b778df..bf60fe14315a32b24dddbd0a7cb91ac53fdf41a3 100644 (file)
@@ -34,6 +34,8 @@ if os.environ.get("READTHEDOCS", "") == "True":
 # add these directories to sys.path here. If the directory is relative to the
 # documentation root, use os.path.abspath to make it absolute, like shown here.
 sys.path.insert(0, os.path.abspath('sphinx'))
+sys.path.append(os.path.abspath('../test/py/tests'))
+sys.path.append(os.path.abspath('../test/py'))
 from load_config import loadConfig
 
 # -- General configuration ------------------------------------------------