home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 559221410

This data as json

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-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
Powered by Datasette · Queries took 0.609ms · About: xarray-datasette