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

2023-08-17 Thread David Spickett via Phabricator via lldb-commits
DavidSpickett added a comment.

I was in this exact situation yesterday but luckily I had already used a 
virtualenv to fix some other Python problems so I knew how to fix it. Had it 
not been for that, seeing the exact Python path would have been very useful 
here, thanks for adding this message.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D158022/new/

https://reviews.llvm.org/D158022

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


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

2023-08-16 Thread Jonas Devlieghere via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG5afa519c1ae9: [lldb] Print better error message when 
sphinx_automodapi is not installed (authored by JDevlieghere).
Herald added a project: LLDB.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D158022/new/

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.


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.
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


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

2023-08-15 Thread Alex Langford via Phabricator via lldb-commits
bulbazord accepted this revision.
bulbazord added a comment.
This revision is now accepted and ready to land.

From the discussion this sounds like a reasonable thing to do.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D158022/new/

https://reviews.llvm.org/D158022

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


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

2023-08-15 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment.

In D158022#4590291 , @mib wrote:

> We should really add a `requirements.txt` file with all the dependencies.

I've long wanted to make this all automated, and have CMake install all the 
necessary dependencies. But that seems a bit intrusive without using something 
like a virtual environment, which would have to be project-wide and more work 
than I'm willing to put in. Regardless, that wouldn't actually help here, at 
least not on macOS if you installed sphinx with homebrew, because it packages 
its own version of Python 
(`/opt/homebrew/Cellar/sphinx-doc/7.1.2/libexec/bin/python`) and you have to 
install the `sphinx_automodapi` module with that. That's why I print 
`sys.executable` and really the motivation behind this patch.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D158022/new/

https://reviews.llvm.org/D158022

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


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

2023-08-15 Thread Med Ismail Bennani via Phabricator via lldb-commits
mib added a comment.

We should really add a `requirements.txt` file with all the dependencies.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D158022/new/

https://reviews.llvm.org/D158022

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


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

2023-08-15 Thread Jonas Devlieghere via Phabricator via lldb-commits
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.


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.
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits