Skip to content

Commit

Permalink
refactor: accommodate recent pymake changes
Browse files Browse the repository at this point in the history
* build code.json/md after building executables
* includes double precision entries in metadata
  • Loading branch information
wpbonelli committed Feb 18, 2024
1 parent 1771ace commit 59bd345
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
pip install -r requirements.txt
pip list
- name: Build executables
- name: Build programs
run: python scripts/build_programs.py

- name: Upload distribution archive
Expand Down
26 changes: 14 additions & 12 deletions scripts/build_programs.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from modflow_devtools.ostags import get_modflow_ostag

DEFAULT_RETRIES = 3
DBL_PREC_PROGRAMS = ["mf2005", "mflgr", "mfnwt", "mfusg"]
DPRECISION_EXES = ["mf2005", "mflgr", "mfnwt", "mfusg"]


def get_fc() -> str:
Expand Down Expand Up @@ -73,19 +73,11 @@ def run_cmd(args) -> bool:
path = Path(args.path)
path.mkdir(parents=True, exist_ok=True)
zip_path = Path(path).with_suffix(".zip")
dp_programs = ",".join(DBL_PREC_PROGRAMS)
dp_exes = ",".join(DPRECISION_EXES)
retries = args.retries
fc = get_fc()
cc = get_cc()

assert run_cmd(
[
"make-code-json",
"-f",
str(path / "code.json"),
"--verbose",
]
), "could not make code.json"
assert run_cmd(
[
"make-program",
Expand All @@ -104,7 +96,7 @@ def run_cmd(args) -> bool:
assert run_cmd(
[
"make-program",
dp_programs,
dp_exes,
"--appdir",
path,
"--double",
Expand All @@ -116,5 +108,15 @@ def run_cmd(args) -> bool:
"--zip",
str(zip_path),
]
), f"could not build double precision binaries: {dp_programs}"
), f"could not build double precision binaries: {dp_exes}"
assert run_cmd(
[
"make-code-json",
"-ad", str(path),
"-f",
str(path / "code.json"),
"--verbose",
]
), "could not make code.json"
assert zip_path.is_file(), "could not build distribution zipfile"
print(f"created distribution zipfile: {zip_path}")

0 comments on commit 59bd345

Please sign in to comment.