From d6247b8b27c23f31c71e0a7a6b0182bce180028e Mon Sep 17 00:00:00 2001 From: black-sliver <59490463+black-sliver@users.noreply.github.com> Date: Thu, 24 Oct 2024 22:52:35 +0200 Subject: [PATCH 1/2] Setup: fix macos SNI download name --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 7a8c22626123..68e122891069 100644 --- a/setup.py +++ b/setup.py @@ -93,7 +93,7 @@ def download_SNI() -> None: platform_name = platform.system().lower() machine_name = platform.machine().lower() # force amd64 on macos until we have universal2 sni, otherwise resolve to GOARCH - machine_name = "amd64" if platform_name == "darwin" else machine_to_go.get(machine_name, machine_name) + machine_name = "universal" if platform_name == "darwin" else machine_to_go.get(machine_name, machine_name) with urllib.request.urlopen("https://api.github.com/repos/alttpo/sni/releases/latest") as request: data = json.load(request) files = data["assets"] From 3d50d17b2ea58a5dcd7eec5b314db2b3ffae8d21 Mon Sep 17 00:00:00 2001 From: black-sliver <59490463+black-sliver@users.noreply.github.com> Date: Thu, 24 Oct 2024 22:53:50 +0200 Subject: [PATCH 2/2] Setup: prefer SNI Windows7 build on py3.8, non-7 on py3.9+ --- setup.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 68e122891069..4d7fc3942017 100644 --- a/setup.py +++ b/setup.py @@ -104,11 +104,13 @@ def download_SNI() -> None: download_url: str = file["browser_download_url"] machine_match = download_url.rsplit("-", 1)[1].split(".", 1)[0] == machine_name if platform_name in download_url and machine_match: + source_url = download_url # prefer "many" builds if "many" in download_url: - source_url = download_url break - source_url = download_url + # prefer the correct windows or windows7 build + if platform_name == "windows" and ("windows7" in download_url) == (sys.version_info < (3, 9)): + break if source_url and source_url.endswith(".zip"): with urllib.request.urlopen(source_url) as download: