Skip to content

Commit

Permalink
Fix ESMFMKFILE env variable not set in RTD build (#577)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomvothecoder authored Dec 5, 2023
1 parent 104a5d5 commit 6238148
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,18 @@
#
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 6238148

Please sign in to comment.