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/.github/workflows/release_dispatch.yml b/.github/workflows/release_dispatch.yml index 1bfc1a0bd52..8705a9608c2 100644 --- a/.github/workflows/release_dispatch.yml +++ b/.github/workflows/release_dispatch.yml @@ -146,7 +146,7 @@ jobs: echo "models=$models" >> $GITHUB_OUTPUT make_dist: name: Make distribution - uses: MODFLOW-USGS/modflow6/.github/workflows/release.yml@develop + uses: wpbonelli/modflow6/.github/workflows/release.yml@fix-nightly-build needs: set_options with: # If the workflow is manually triggered, the maintainer must manually set approve=true to approve a release. diff --git a/distribution/build_docs.py b/distribution/build_docs.py index e34241b8791..a9d11891b6b 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 @@ -266,12 +266,13 @@ def build_mf6io_tex_from_dfn( if overwrite: clean_tex_files() - def files_match(tex_path, dfn_path, ignored): + def files_match(tex_path, dfn_path, included, ignored): dfn_names = [ f.stem for f in dfn_path.glob("*") if f.is_file() and "dfn" in f.suffix + and any(pattern in f.name for pattern in included) and not any(pattern in f.name for pattern in ignored) ] tex_names = [ @@ -282,10 +283,18 @@ 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"] + included = models + ["sim", "utl", "exg", "sln"] tex_pth = Path("tex") dfn_pth = Path("dfn") tex_files = [f for f in tex_pth.glob("*") if f.is_file()] @@ -308,11 +317,11 @@ def files_match(tex_path, dfn_path, ignored): if models is not None and any(models): for model in models: args += ["--model", model] - out, err, ret = run_cmd(*args) + out, err, ret = run_cmd(*args, verbose=True) assert not ret, out + err # check that dfn and tex files match - assert files_match(tex_pth, dfn_pth, ignored) + assert files_match(tex_pth, dfn_pth, included, ignored) @no_parallel 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)