html_url,issue_url,id,node_id,user,created_at,updated_at,author_association,body,reactions,performed_via_github_app,issue https://github.com/pydata/xarray/issues/3567#issuecomment-562573848,https://api.github.com/repos/pydata/xarray/issues/3567,562573848,MDEyOklzc3VlQ29tbWVudDU2MjU3Mzg0OA==,14808389,2019-12-06T13:36:03Z,2019-12-06T13:36:03Z,MEMBER,looks like it is supported but the maintainer of `nbsphinx` didn't know about it.,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,527755536 https://github.com/pydata/xarray/issues/3567#issuecomment-561270215,https://api.github.com/repos/pydata/xarray/issues/3567,561270215,MDEyOklzc3VlQ29tbWVudDU2MTI3MDIxNQ==,14808389,2019-12-03T17:22:30Z,2019-12-03T17:47:12Z,MEMBER,"It seems we can solve this by setting `setup_py_install: false` and adding these lines to `conf.py`: ```python import os import pathlib import sys root = pathlib.Path(__file__).parent.parent.absolute() os.environ[""PYTHONPATH""] = str(root) sys.path.insert(0, str(root)) ``` what confuses me is that the `nbsphinx` documentation does not mention this trick. Edit: I asked the `nbsphinx` developers about this, let's see what they think.","{""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,527755536 https://github.com/pydata/xarray/issues/3567#issuecomment-559221410,https://api.github.com/repos/pydata/xarray/issues/3567,559221410,MDEyOklzc3VlQ29tbWVudDU1OTIyMTQxMA==,14808389,2019-11-27T19:26:00Z,2019-11-30T13:43:46Z,MEMBER,"this is something that looks somewhat like a hack to me, but how about not installing at all but rather using ```bash PYTHONPATH=$(readlink -f ..) sphinx-build -M html -d _build/doctrees -n . _build/html ``` to call sphinx (the important part is the environment variable)? I think that should run the correct module even if a different version should happen to be installed. Edit: unfortunately `readlink -f ..` (or something similar to get the absolute path) is required: just using `..` is not possible. Unless the RTD build always puts the checked out project in the same location in the container, we need to execute a shell command. Edit2: it might have side-effects, but using `PYTHONPATH=..:../..` seems to work. The reason for this is that the kernels get started with `PWD=doc/examples`. Of course, that does not work in general (probably has the same issues as installing) and using the absolute path would be the correct way. Unfortunately, readthedocs puts a branch component into the directory path, which means we can't hard-code. Actually, we only need `PYTHONPATH=../..` since we can just modify `sys.path` in `conf.py` and also remove any side-effects: ```python import pathlib import sys root = pathlib.Path(__file__).parent.parent.absolute() sys.path = [path for path in sys.path if path not in (str(root), str(root.parent))] sys.path.insert(0, str(root)) ``` but this looks even more like a hack to me. What do you think?","{""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,527755536