Skip to content

Commit

Permalink
Update .readthedocs.yml to set env varibles
Browse files Browse the repository at this point in the history
  • Loading branch information
tomvothecoder committed Dec 5, 2023
1 parent 6238148 commit e5fa22c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ build:
os: "ubuntu-20.04"
tools:
python: "mambaforge-4.10"
jobs:
post_create_environment:
# Use conda run executable wrapper to set all env variables, including ESMFMKFILE.
# Source: https://github.com/readthedocs/readthedocs.org/issues/5339#issuecomment-1576603529
- conda run -n ${CONDA_DEFAULT_ENV} pip install . --no-deps

# Build documentation in the docs/ directory with Sphinx
sphinx:
Expand Down
8 changes: 0 additions & 8 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,10 @@
#
import os
import sys
from pathlib import Path
from typing import Dict

import sphinx_autosummary_accessors

# A workaround that sets the "ESMFMKFILE" env variable for the Read The Docs
# build to work. Read The Docs does not activate the conda environment which
# causes "ESMFMKFILE" to not be set (required by `esmpy` and `xesmf`).
# Source: https://github.com/conda-forge/esmf-feedstock/issues/91
if os.environ.get("READTHEDOCS") and "ESMFMKFILE" not in os.environ:
os.environ["ESMFMKFILE"] = str(Path(os.__file__).parent.parent / "esmf.mk")

sys.path.insert(0, os.path.abspath("..")) # noqa: I001, I003
import xcdat # noqa: I001, E402

Expand Down

0 comments on commit e5fa22c

Please sign in to comment.