From 0a6a4938fde589fe8f2160fc542428ef100153ce Mon Sep 17 00:00:00 2001 From: Keewis Date: Tue, 3 Dec 2019 17:49:08 +0100 Subject: [PATCH 1/4] add the project root to PYTHONPATH and sys.path --- doc/conf.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/conf.py b/doc/conf.py index 65635353e93..c1c9fd2718d 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -15,10 +15,15 @@ import datetime import os +import pathlib import subprocess import sys from contextlib import suppress +root = pathlib.Path(__file__).absolute().parent.parent +os.environ["PYTHONPATH"] = str(root) +sys.path.insert(0, str(root)) + import xarray allowed_failures = set() From 536864474194c70b78fbf8573665665ca9bf17ba Mon Sep 17 00:00:00 2001 From: Keewis Date: Tue, 3 Dec 2019 18:21:00 +0100 Subject: [PATCH 2/4] don't install the package --- readthedocs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readthedocs.yml b/readthedocs.yml index 6429780e7d7..c64fa1b7b02 100644 --- a/readthedocs.yml +++ b/readthedocs.yml @@ -4,5 +4,5 @@ conda: file: ci/requirements/doc.yml python: version: 3.7 - setup_py_install: true + setup_py_install: false formats: [] From 7f2dd387430cd5f9f13c04c957e21b87e16e1469 Mon Sep 17 00:00:00 2001 From: Keewis Date: Tue, 3 Dec 2019 18:30:25 +0100 Subject: [PATCH 3/4] update the requirements for the documentation environment so we definitely trigger the version collision. --- ci/requirements/doc.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ci/requirements/doc.yml b/ci/requirements/doc.yml index f2c09ed6fef..97488e7f581 100644 --- a/ci/requirements/doc.yml +++ b/ci/requirements/doc.yml @@ -6,7 +6,7 @@ dependencies: - python=3.7 - bottleneck - cartopy - - eccodes + - cfgrib - h5netcdf - ipykernel - ipython @@ -21,8 +21,5 @@ dependencies: - seaborn - sphinx - sphinx_rtd_theme + - xarray - zarr - - pip - - pip: - - cfgrib - From 1a075fe84273ef06942f43d38d6645cc8f042dd8 Mon Sep 17 00:00:00 2001 From: Keewis Date: Tue, 3 Dec 2019 19:55:29 +0100 Subject: [PATCH 4/4] comment on the reasons for the sys.path and os.environ modifications --- doc/conf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/conf.py b/doc/conf.py index c1c9fd2718d..11abda6bb63 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -20,6 +20,7 @@ import sys from contextlib import suppress +# make sure the source version is preferred (#3567) root = pathlib.Path(__file__).absolute().parent.parent os.environ["PYTHONPATH"] = str(root) sys.path.insert(0, str(root))