I am still trying to figure out how to build the documentation locally such that it uses my locally built js library…
In that effort I was setting the environment variable BOKEH_RESOURCES to various modes of ‘inline’, ‘relative’, and ‘relative-div’ in addition to the environment variable BOKEH_ROOTDIR. Even though I had the BOKEH_RESOURCES set to ‘relative-dev’, I received an error from the console telling me that the setting of the root directory only makes sense if the resources mode is set to either ‘relative’ or ‘relative-dev’. In this case I had and the error was not making sense. I took a look at the Resources class and noticed that the error logic was using the function parameter vice the instance variable to do its logic. This does not seem correct. I have placed a smipplet of the relevant code below.
///// BEGIN SNIP (bokeh/resources.py at branch-3.0 · bokeh/bokeh · GitHub, line 110)
raise ValueError("wrong value for ‘mode’ parameter, expected ", “‘inline’, ‘cdn’, ‘server(-dev)’, ‘relative(-dev)’ or ‘absolute(-dev)’, got %r” % self.mode)
if self.root_dir and not mode.startswith(“relative”):
raise ValueError(“setting ‘root_dir’ makes sense only when ‘mode’ is set to ‘relative’”)
if self.version and not mode.startswith(‘cdn’):
raise ValueError(“setting ‘version’ makes sense only when ‘mode’ is set to ‘cdn’”)
if root_url and not mode.startswith(‘server’):
raise ValueError(“setting ‘root_url’ makes sense only when ‘mode’ is set to ‘server’”)
////// END SNIP
Should all of the cases of ‘mode’ in the above be replaced with ‘self.mode’? I would have made this an issue right away but I wanted to make sure there was no black magic at play here. If there is in fact an issue here, I will create an issue and then make a small pull request.
Also, as an aside, if anybody here can tell me how to build the docs using a the local version of the js library I would be very grateful. Setting the env var BOKEH_RESOURCES to ‘inline’ does not seem to do the trick.
Justace