click-contrib / sphinx-click

A Sphinx plugin to automatically document click-based applications
MIT License
212 stars 57 forks source link

Greater Import Error Context / Stack Trace #17

Closed jamesstidard closed 6 years ago

jamesstidard commented 6 years ago

python 3.4.6 sphinx-click 1.0.3 sphinx 1.5.3

Currently if there is an error when building the documentation any failures importing will be reported like this:

reading sources... [100%] pages/my_page                                                                                                                                                                                                
/path/to/pages/my_page.rst:1: ERROR: Failed to import "cli" from "src.cli.__main__"

In my case this import was failing due to a silly syntax error I introduced somewhere in my source code.

It would be nice to have that stack trace of the syntax error pushed up to the command's output so it's easier to diagnose the cause of the failed import.

Thanks.

stephenfin commented 6 years ago

This is available in release 1.0.4

jamesstidard commented 6 years ago

thanks for all the work @stephenfin