Skip to content

Commit

Permalink
feat(get-modflow): support ARM mac nightly build
Browse files Browse the repository at this point in the history
  • Loading branch information
wpbonelli committed Feb 23, 2024
1 parent 4e6f4c1 commit 9e0d57d
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions flopy/utils/get_modflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import zipfile
from importlib.util import find_spec
from pathlib import Path
from platform import processor

__all__ = ["run_main"]
__license__ = "CC0"
Expand All @@ -33,7 +34,7 @@
"modflow6-nightly-build": "modflow6_nightly",
}
available_repos = list(renamed_prefix.keys())
available_ostags = ["linux", "mac", "win32", "win64"]
available_ostags = ["linux", "mac", "macarm", "win32", "win64"]
max_http_tries = 3

# Check if this is running from flopy
Expand Down Expand Up @@ -405,16 +406,25 @@ def run_main(
# get the selected release
release = get_release(owner, repo, release_id, quiet)
assets = release.get("assets", [])

asset_names = [a["name"] for a in assets]
for asset in assets:
if ostag in asset["name"]:
asset_name = asset["name"]
if ostag in asset_name:
# temporary hack for nightly gfortran build for ARM macs
# todo: clean up if/when all repos have an ARM mac build
if (
repo == "modflow6-nightly-build"
and "macarm.zip" in asset_names
and processor() == "arm"
and ostag == "mac.zip"
):
continue
break
else:
raise ValueError(
f"could not find ostag {ostag!r} from release {release['tag_name']!r}; "
f"see available assets here:\n{release['html_url']}"
)
asset_name = asset["name"]
download_url = asset["browser_download_url"]
if repo == "modflow6":
asset_pth = Path(asset_name)
Expand Down

0 comments on commit 9e0d57d

Please sign in to comment.