diff --git a/scripts/update_intersphinx_mapping.py b/scripts/update_intersphinx_mapping.py deleted file mode 100644 index fc7c831d..00000000 --- a/scripts/update_intersphinx_mapping.py +++ /dev/null @@ -1,96 +0,0 @@ -""" -Update the intersphinx_mapping value in conf.py - -You should run this after you run `jupyterbook config sphinx`. -""" -__author__ = "Dan Gunter (LBNL)" - -import argparse -import logging -from pathlib import Path -from subprocess import check_call, CalledProcessError -import sys -from tempfile import TemporaryFile -import yaml -from idaes.core.util.intersphinx import get_intersphinx_mapping - -CONF_FILE = "_config.yml" - -logging.basicConfig() -_log = logging.getLogger("update_intersphinx_mapping") -_log.setLevel(logging.INFO) - - -def modify(path): - ix_indent, in_ix = 0, False - # get the mapping to insert - mapping = get_intersphinx_mapping() - # change tuples to lists so yaml.dump doesn't do weird things - for key in mapping: - mapping[key] = list(mapping[key]) - # parse & load current config file - with path.open("r") as f: - try: - data = yaml.safe_load(f) - except yaml.parser.ParserError as err: - _log.error(f"Parsing config file '{path}': {err}") - raise - # modify data in memory - try: - data["sphinx"]["config"]["intersphinx_mapping"] = mapping - except KeyError as err: - _log.error(f"Modifying config file '{path}': {err} ") - raise - # dump modified data - with path.open("w") as f: - yaml.dump(data, f) - - -if __name__ == "__main__": - ap = argparse.ArgumentParser() - ap.add_argument("-d", "--dir", - help="Directory containing conf.py (default=.)", - default=None) - ap.add_argument("-c", "--command", - action="store_true", - help="Run `jupyter-book config sphinx