[Lldb-commits] [PATCH] D158022: [lldb] Print an actionable error message when sphinx_automodapi is not installed

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Aug 15 14:08:36 PDT 2023


JDevlieghere created this revision.
JDevlieghere added a reviewer: LLDB.
Herald added a project: All.
JDevlieghere requested review of this revision.

Print an error message with instructions on how to install sphinx_automodapi.


https://reviews.llvm.org/D158022

Files:
  lldb/docs/conf.py


Index: lldb/docs/conf.py
===================================================================
--- lldb/docs/conf.py
+++ lldb/docs/conf.py
@@ -49,6 +49,12 @@
 # Unless we only generate the basic manpage we need the plugin for generating
 # the Python API documentation.
 if not building_man_page:
+    try:
+        import sphinx_automodapi.automodapi
+    except ModuleNotFoundError:
+        print(
+            f"install sphinx_automodapi with {sys.executable} -m pip install sphinx_automodapi"
+        )
     extensions.append("sphinx_automodapi.automodapi")
 
 # Add any paths that contain templates here, relative to this directory.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D158022.550468.patch
Type: text/x-patch
Size: 638 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20230815/60aac7b8/attachment.bin>


More information about the lldb-commits mailing list