@mattpap I believe the root cause of this has to do with the cwd is set when the app is run. It works for "directory style" apps, but I am fairly certain it does not work well with single file apps.
This makes manual setting of __imlementation__ work, but not logic in custom module compiler. The reason is the custom models are resolved at later time, when those two lines aren't in effect anymore, and because Python graciously resolves module paths as relative if a module is run from the current directory and it's path is on sys.path (both conditions are met here) and as absolute otherwise. Don't know why anyone would invent such a thing, besides making things aesthetically pleasing, but this was fixed in 3.4. The only non-obtrusive solution I found, is to replace those two lines with:
sys.path.insert(0, os.path.dirname(self._path))
where self._path is already absolute. This makes both:
work at the same time. Obviously current directory is now set to wherever bin/bokeh was run from. I didn't yet fully analyzed this, but this may not have any negative effect, because we uniformly used __file__ to derive location of auxiliary files.
Migration note: we will no longer os.chdir into app directories, but __file__ will have correct path that can be used with open, etc. (which we already demonstrate, but let's underscore this more)
see ref: #5304
The text was updated successfully, but these errors were encountered: