Skip to content

Commit

Permalink
chore(get-modflow): revert 4c5e2ee for now (modflowpy#2113)
Browse files Browse the repository at this point in the history
* until ARM mac distributions supported from all three distributions?
  • Loading branch information
wpbonelli authored Feb 20, 2024
1 parent 40c0391 commit 63c2af0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
12 changes: 4 additions & 8 deletions autotest/test_get_modflow.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Test get-modflow utility."""

import os
import platform
import sys
Expand All @@ -21,11 +20,9 @@
flopy_dir = get_project_root_path()
get_modflow_script = flopy_dir / "flopy" / "utils" / "get_modflow.py"
bindir_options = {
"flopy": (
Path(expandvars(r"%LOCALAPPDATA%\flopy")) / "bin"
if system() == "Windows"
else Path.home() / ".local" / "share" / "flopy" / "bin"
),
"flopy": Path(expandvars(r"%LOCALAPPDATA%\flopy")) / "bin"
if system() == "Windows"
else Path.home() / ".local" / "share" / "flopy" / "bin",
"python": Path(sys.prefix)
/ ("Scripts" if system() == "Windows" else "bin"),
"home": Path.home() / ".local" / "bin",
Expand Down Expand Up @@ -119,6 +116,7 @@ def test_get_release(repo):
tag = "latest"
release = get_release(repo=repo, tag=tag)
assets = release["assets"]

expected_assets = ["linux.zip", "mac.zip", "win64.zip"]
expected_ostags = [a.replace(".zip", "") for a in expected_assets]
actual_assets = [asset["name"] for asset in assets]
Expand All @@ -128,8 +126,6 @@ def test_get_release(repo):
assert {a.rpartition("_")[2] for a in actual_assets} >= {
a for a in expected_assets if not a.startswith("win")
}
elif repo == "modflow6-nightly-build":
expected_assets.append("macarm.zip")
else:
for ostag in expected_ostags:
assert any(
Expand Down
7 changes: 3 additions & 4 deletions flopy/utils/get_modflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import zipfile
from importlib.util import find_spec
from pathlib import Path
from platform import processor

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

# Check if this is running from flopy
Expand All @@ -61,7 +60,7 @@ def get_ostag() -> str:
elif sys.platform.startswith("win"):
return "win" + ("64" if sys.maxsize > 2**32 else "32")
elif sys.platform.startswith("darwin"):
return "macarm" if processor() == "arm" else "mac"
return "mac"
raise ValueError(f"platform {sys.platform!r} not supported")


Expand All @@ -70,7 +69,7 @@ def get_suffixes(ostag) -> Tuple[str, str]:
return ".exe", ".dll"
elif ostag == "linux":
return "", ".so"
elif "mac" in ostag:
elif ostag == "mac":
return "", ".dylib"
else:
raise KeyError(
Expand Down

0 comments on commit 63c2af0

Please sign in to comment.