diff --git a/.build_rtd_docs/conf.py b/.build_rtd_docs/conf.py index 2de05fbe9be..bfc37a3a41f 100644 --- a/.build_rtd_docs/conf.py +++ b/.build_rtd_docs/conf.py @@ -81,6 +81,18 @@ dst = os.path.join(dstdir, fpth) shutil.copy(src, dst) +# -- build the deprecations table -------------------------------------------- +print("Build the deprecations markdown table") +pth = os.path.join("..", "doc", "mf6io", "mf6ivar") +args = (sys.executable, "deprecations.py") +# run the command +proc = Popen(args, stdout=PIPE, stderr=PIPE, cwd=pth) +stdout, stderr = proc.communicate() +if stdout: + print(stdout.decode("utf-8")) +if stderr: + print("Errors:\n{}".format(stderr.decode("utf-8"))) + # -- copy deprecations markdown --------------------------------------------- print("Copy the deprecations table") dstdir = "_mf6run" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 38ed678f955..7bc96b13c3e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -73,7 +73,7 @@ jobs: version: ${{ inputs.compiler_version }} optimization: 2 parallel: false - - os: macos-13 + - os: macos-12 compiler: ${{ inputs.compiler_toolchain }} version: ${{ inputs.compiler_version }} optimization: 2 diff --git a/distribution/build_docs.py b/distribution/build_docs.py index e34241b8791..e1efed3e019 100644 --- a/distribution/build_docs.py +++ b/distribution/build_docs.py @@ -7,7 +7,7 @@ from datetime import datetime from os import PathLike, environ from pathlib import Path -from pprint import pprint +from pprint import pformat, pprint from tempfile import TemporaryDirectory from typing import List, Optional from urllib.error import HTTPError @@ -282,7 +282,13 @@ def files_match(tex_path, dfn_path, ignored): and not any(pattern in f.name for pattern in ignored) ] - return set(tex_names) == set(dfn_names) + tex = set(tex_names) + dfn = set(dfn_names) + diff = tex ^ dfn + assert not any(diff), \ + f"=> symmetric difference:\n{pformat(diff)}\n" + f"=> tex - dfn:\n{pformat(tex - dfn)}\n" + f"=> dfn - tex:\n{pformat(dfn - tex)}\n" with set_dir(PROJ_ROOT_PATH / "doc" / "mf6io" / "mf6ivar"): ignored = ["appendix", "common"] diff --git a/doc/mf6io/mf6ivar/deprecations.py b/doc/mf6io/mf6ivar/deprecations.py index d6896607e83..9f2efe0f5f5 100644 --- a/doc/mf6io/mf6ivar/deprecations.py +++ b/doc/mf6io/mf6ivar/deprecations.py @@ -1,9 +1,11 @@ -import os from pathlib import Path from typing import List, Optional, Tuple from packaging.version import Version +PROJ_ROOT_PATH = Path(__file__).parents[3] +MF6IVAR_PATH = PROJ_ROOT_PATH / "doc" / "mf6io" / "mf6ivar" + def get_deprecations( dfndir, @@ -33,7 +35,7 @@ def get_deprecations( def create_deprecations_file(dfndir, mddir, verbose): deprecations = get_deprecations(dfndir) - deps_path = (Path(mddir) / "deprecations.md").absolute() + deps_path = (mddir / "deprecations.md").absolute() if verbose: print(f"Found {len(deprecations)} deprecations, writing {deps_path}") with open(deps_path, "w") as f: @@ -50,6 +52,7 @@ def create_deprecations_file(dfndir, mddir, verbose): if __name__ == "__main__": - dfndir = os.path.join(".", "dfn") - mddir = os.path.join(".", "md") + dfndir = MF6IVAR_PATH / "dfn" + mddir = MF6IVAR_PATH / "md" + mddir.mkdir(exist_ok=True) create_deprecations_file(dfndir, mddir, verbose=True)