Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: accommodate recent pymake changes #26

Merged
merged 7 commits into from
Feb 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,22 @@ jobs:
meson setup builddir --prefix=$(pwd) --libdir=bin -Ddebug=false
meson install -C builddir

- name: Get OS tag
id: ostag
run: |
ostag=$(python -c "from modflow_devtools.ostags import get_ostag; print(get_ostag())")
echo "ostag=$ostag" >> $GITHUB_OUTPUT

- name: Build programs
run: |
# build programs
mkdir programs
python executables/scripts/build_programs.py -p programs
ostag="${{ steps.ostag.outputs.ostag }}"
mkdir $ostag
python executables/scripts/build_programs.py -p $ostag

# move programs where mf6 autotests expect them
mkdir modflow6/bin/downloaded
cp programs/* modflow6/bin/downloaded
cp $ostag/* modflow6/bin/downloaded

# move mf6 binaries to top-level bindir in mf6 repo
if [[ "$RUNNER_OS" == "Windows" ]]; then
Expand All @@ -77,9 +84,9 @@ jobs:
eext=""
oext=".dylib"
fi
cp "programs/mf6$eext" modflow6/bin
cp "programs/libmf6$oext" modflow6/bin
cp "programs/zbud6$eext" modflow6/bin
cp "$ostag/mf6$eext" modflow6/bin
cp "$ostag/libmf6$oext" modflow6/bin
cp "$ostag/zbud6$eext" modflow6/bin

# set execute permissions
if [[ "$RUNNER_OS" != "Windows" ]]; then
Expand All @@ -90,8 +97,8 @@ jobs:
- name: Upload programs
uses: actions/upload-artifact@v3
with:
name: programs
path: programs.zip
name: ${{ steps.ostag.outputs.ostag }}
path: ${{ steps.ostag.outputs.ostag }}.zip

- name: Upload metadata
if: runner.os == 'Linux'
Expand All @@ -106,4 +113,5 @@ jobs:
working-directory: modflow6/autotest
run: |
python update_flopy.py
pytest -v -n auto -k "not gwe" -m "not developmode" --durations 0
# when mf6.5.0 is released with new models and exes dist is updatd, remove filters below
pytest -v -n auto -k "not gwe and not swf and not prt" -m "not developmode" --durations 0
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
27 changes: 14 additions & 13 deletions scripts/build_programs.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import argparse
import sys
import subprocess
import sys
import textwrap
from pathlib import Path

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,14 @@ 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),
"--verbose",
wpbonelli marked this conversation as resolved.
Show resolved Hide resolved
]
), "could not make code.json"
assert zip_path.is_file(), "could not build distribution zipfile"
print(f"created distribution zipfile: {zip_path}")
Loading