From 63c2af005a3b01164a7e424b9f624c33ef722e03 Mon Sep 17 00:00:00 2001 From: wpbonelli Date: Tue, 20 Feb 2024 08:29:23 -0500 Subject: [PATCH] chore(get-modflow): revert 4c5e2ee for now (#2113) * until ARM mac distributions supported from all three distributions? --- autotest/test_get_modflow.py | 12 ++++-------- flopy/utils/get_modflow.py | 7 +++---- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/autotest/test_get_modflow.py b/autotest/test_get_modflow.py index b06b8cdb24..3228dce218 100644 --- a/autotest/test_get_modflow.py +++ b/autotest/test_get_modflow.py @@ -1,5 +1,4 @@ """Test get-modflow utility.""" - import os import platform import sys @@ -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", @@ -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] @@ -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( diff --git a/flopy/utils/get_modflow.py b/flopy/utils/get_modflow.py index 77bbc268ed..54c2a7d12c 100755 --- a/flopy/utils/get_modflow.py +++ b/flopy/utils/get_modflow.py @@ -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" @@ -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 @@ -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") @@ -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(