Skip to content

Commit ed05f98

Browse files
keewismax-sixty
authored andcommitted
Resolve the version issues on RTD (#3589)
* add the project root to PYTHONPATH and sys.path * don't install the package * update the requirements for the documentation environment so we definitely trigger the version collision. * comment on the reasons for the sys.path and os.environ modifications
1 parent 69c85b8 commit ed05f98

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

ci/requirements/doc.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ dependencies:
66
- python=3.7
77
- bottleneck
88
- cartopy
9-
- eccodes
9+
- cfgrib
1010
- h5netcdf
1111
- ipykernel
1212
- ipython
@@ -21,8 +21,5 @@ dependencies:
2121
- seaborn
2222
- sphinx
2323
- sphinx_rtd_theme
24+
- xarray
2425
- zarr
25-
- pip
26-
- pip:
27-
- cfgrib
28-

doc/conf.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,16 @@
1515

1616
import datetime
1717
import os
18+
import pathlib
1819
import subprocess
1920
import sys
2021
from contextlib import suppress
2122

23+
# make sure the source version is preferred (#3567)
24+
root = pathlib.Path(__file__).absolute().parent.parent
25+
os.environ["PYTHONPATH"] = str(root)
26+
sys.path.insert(0, str(root))
27+
2228
import xarray
2329

2430
allowed_failures = set()

readthedocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ conda:
44
file: ci/requirements/doc.yml
55
python:
66
version: 3.7
7-
setup_py_install: true
7+
setup_py_install: false
88
formats: []

0 commit comments

Comments
 (0)