question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

sphinxext.bokeh_plot broken

See original GitHub issue

ALL software version info (bokeh, python, notebook, OS, browser, any other relevant pacakges)

This was the result of conda create -n minimal python=3.5 sphinx bokeh today on OS X 10.11.6, replicated also on another mac running 10.11. Full result of conda list below in case it’s helpful. Note also that @handwerkerd verified also not working with latext Sphinx 1.5.3.

alabaster                 0.7.10                   py35_0  
babel                     2.3.4                    py35_0  
bokeh                     0.12.4                   py35_0  
docutils                  0.13.1                   py35_0  
imagesize                 0.7.1                    py35_0  
jinja2                    2.9.5                    py35_0  
markupsafe                0.23                     py35_2  
mkl                       2017.0.1                      0  
numpy                     1.12.0                   py35_0  
openssl                   1.0.2k                        0  
pip                       9.0.1                    py35_1  
pygments                  2.2.0                    py35_0  
python                    3.5.3                         0  
python-dateutil           2.6.0                    py35_0  
pytz                      2016.10                  py35_0  
pyyaml                    3.12                     py35_0  
readline                  6.2                           2  
requests                  2.13.0                   py35_0  
setuptools                27.2.0                   py35_0  
six                       1.10.0                   py35_0  
snowballstemmer           1.2.1                    py35_0  
sphinx                    1.5.1                    py35_0  
sqlite                    3.13.0                        0  
tk                        8.5.18                        0  
tornado                   4.4.2                    py35_0  
wheel                     0.29.0                   py35_0  
xz                        5.2.2                         1  
yaml                      0.1.6                         0  
zlib                      1.2.8                         3  

Description of expected behavior and the observed behavior

Clone and build this with make html. We should get a simple sphinx doc with a simple bokeh plot. As I note in the index.rst, I grabbed the bokeh plot code directly from the docs in bokeh/sphinxext/bokeh_plot.py.

Complete, minimal, self-contained example code that reproduces the issue

https://github.com/davclark/simple-bokeh-sphinx/tree/broken

Stack traceback and/or browser JavaScript console output

Trimmed error to console:

reading sources... [ 50%] conf                                                                        
Exception occurred:
  File "/Users/clarkda/miniconda3/envs/minimal/lib/python3.5/site-packages/bokeh/sphinxext/bokeh_plot.py", line 125, in _process_script
    js, script = autoload_static(d.roots[0], resources, script_path)
IndexError: list index out of range
The full traceback has been saved in /var/folders/longhashystring.log, if you want to report the issue to the developers.

I’ll put /var/folders/longhashystring.log in a subsequent note.

Screenshots or screencasts of the bug in action

Not relevant.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
bryevdvcommented, Feb 18, 2019

@davclark @cdeil @handwerkerd just a heads up that a PR #8665 to be merged for 1.1 makes the plot scripts always unconditionally be placed adjacent to the document they are for, and always loads them using relative URLs. The hacky options in #6223 are now no longer necessary, and will no longer have any effect (tho supplying them will not cause an error, until 2.0) I think this is a positive change that will allow bokeh-plot to always work without needing complicated extra configuration, and I don’t believe it will adversely affect any current usage (by the few folks that use bokeh-plot) but please reach out if any issues arise after 1.1. is released.

1reaction
bryevdvcommented, Mar 3, 2017

That said, focusing on your solution to this bug, I’m a sphinx amateur, but the conf.py file is necessary for sphinx and probably should never be parsed by Bokeh.

I certainly agree with this, and it was certainly not my intent to execute conf.py. In fact, the reason why conf.py is not considered when the Bokeh docs are run, is because it is explicitly excluded in our conf.py:

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
#
# NOTE: in these docs all .py script are assumed to be bokeh plot scripts
exclude_patterns = ['conf.py']

I do think the directive needs to be made more configurable and robust to support better general use, but if you add this to your conf.py that should get around the immediate problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues building Sphinx documentation - Community Support - Bokeh ...
Hi all, I'm trying to build Sphinx Bokeh documentation locally. I was able to build bokeh from source code as explained in the...
Read more >
Source code for pyquickhelper.sphinxext.bokeh.bokeh_plot
The ``bokeh-plot`` directive can be used by either supplying, **a path to a source file** as the argument to the directive:: .. bokeh-plot::...
Read more >
DocOnce Description 1.0 documentation - Various writings
A Bokeh plot will often have a save button that can be used to save the plot to PNG ... The non-breaking character...
Read more >
documentation - 1/1 — pyquickhelper 1.4.1338
After this short break, the latex compilation runs fine on Jenkins. ... in the documentation with the extension bokeh.sphinxext.bokeh_plot.
Read more >
python-bokeh-0.12.15-bp150.1.3 - SUSE Package Hub -
... + #7520 [component: docs] Bokeh-plot directive incomptable with sphinx 1.7 ... + #5951 [component: docs] Sphinxext.bokeh_plot broken + #6040 [component: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found