Skip to content

Commit

Permalink
ci(release): fix nightly build
Browse files Browse the repository at this point in the history
  • Loading branch information
wpbonelli committed Jul 18, 2024
1 parent 1fd801d commit 8e801bf
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 7 deletions.
12 changes: 12 additions & 0 deletions .build_rtd_docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 8 additions & 2 deletions distribution/build_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"]
Expand Down
11 changes: 7 additions & 4 deletions doc/mf6io/mf6ivar/deprecations.py
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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:
Expand All @@ -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)

0 comments on commit 8e801bf

Please sign in to comment.