From: Tom Rini Date: Mon, 9 Mar 2026 18:09:52 +0000 (-0600) Subject: doc: Use sys.path.append for pytests being found X-Git-Tag: v2026.04~6^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d0dfaacf57a2a0fa4a5c09223e62fdddef544052;p=thirdparty%2Fu-boot.git doc: Use sys.path.append for pytests being found 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 --- diff --git a/Makefile b/Makefile index c175af95aca..f232d8b4ea2 100644 --- 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 diff --git a/doc/conf.py b/doc/conf.py index 84d028feda8..bf60fe14315 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -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 ------------------------------------------------