From a69d74c842a0f55ffa1408fa058138ac9637a0c6 Mon Sep 17 00:00:00 2001 From: Nicolas Dechesne Date: Fri, 18 Sep 2020 10:14:14 +0200 Subject: sphinx: report errors when dependencies are not met To build the Sphinx documentation, we have the following dependencies: * sphinx * sphinx_rtd_theme * pyyaml If any of these dependencies are missing, we might end up with some cryptic error messages. This patch adds better error reporting when dependencies are not met. (From yocto-docs rev: 19df8d1ec56dc2ecb44122288cc53e84237fab69) Signed-off-by: Nicolas Dechesne Signed-off-by: Richard Purdie --- documentation/conf.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'documentation/conf.py') diff --git a/documentation/conf.py b/documentation/conf.py index 34d1bc97a4..f2dd2556fa 100644 --- a/documentation/conf.py +++ b/documentation/conf.py @@ -91,10 +91,16 @@ intersphinx_mapping = { # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -html_theme = 'sphinx_rtd_theme' -html_theme_options = { - 'sticky_navigation': False, -} +try: + import sphinx_rtd_theme + html_theme = 'sphinx_rtd_theme' + html_theme_options = { + 'sticky_navigation': False, + } +except ImportError: + sys.stderr.write("The Sphinx sphinx_rtd_theme HTML theme was not found.\ + \nPlease make sure to install the sphinx_rtd_theme python package.\n") + sys.exit(1) html_logo = 'sphinx-static/YoctoProject_Logo_RGB.jpg' -- cgit v1.2.3-54-g00ecf