Skip to content

Commit 0a6339c

Browse files
committed
fix: github actions windows ARM support
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
1 parent 1ea9b9b commit 0a6339c

File tree

3 files changed

+23
-6
lines changed

3 files changed

+23
-6
lines changed

.github/action_helper.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import annotations
22

33
import json
4+
import platform
45
import sys
56

67

@@ -20,6 +21,11 @@ def filter_version(version: str) -> str:
2021
# remove extra specifier e.g. "3.12-dev" => "3.12", "~3.12.0-0" => "3.12"
2122
version_ = version_.split("-")[0]
2223

24+
# Handle free-threaded
25+
free_threaded = version_.endswith("t")
26+
if free_threaded:
27+
version_ = version_[:-1]
28+
2329
version_parts = version_.split(".")
2430
if len(version_parts) < 2:
2531
msg = f"invalid version: {version}"
@@ -30,7 +36,17 @@ def filter_version(version: str) -> str:
3036
if not version_parts[1].isdigit():
3137
msg = f"invalid minor python version: {version}"
3238
raise ValueError(msg)
33-
return ".".join(version_parts[:2])
39+
return ".".join(version_parts[:2]) + ("t" if free_threaded else "")
40+
41+
42+
def valid_version(version: str) -> bool:
43+
if sys.platform.startswith("win32") and platform.machine().lower() in {
44+
"arm64",
45+
"aarch64",
46+
}:
47+
if version in {"2.7", "3.6", "3.7", "3.8", "3.9", "3.10"}:
48+
return False
49+
return True
3450

3551

3652
def setup_action(input_: str, *, self_version: str = "3.12") -> None:
@@ -58,7 +74,7 @@ def setup_action(input_: str, *, self_version: str = "3.12") -> None:
5874

5975
# cpython shall be installed last because
6076
# other interpreters also define pythonX.Y symlinks.
61-
versions = pypy_versions + cpython_versions
77+
versions = [v for v in pypy_versions + cpython_versions if valid_version(v)]
6278

6379
# we want to install our own self version last to ease nox set-up
6480
if self_version in cpython_versions_filtered:

.github/workflows/action.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,12 @@ jobs:
2323
strategy:
2424
matrix:
2525
os:
26-
- ubuntu-22.04
2726
- ubuntu-24.04
2827
- ubuntu-24.04-arm
2928
- windows-2022
3029
- windows-2025
31-
- macos-13
32-
- macos-14
30+
- windows-11-arm
31+
- macos-15-intel
3332
- macos-15
3433
steps:
3534
- uses: actions/checkout@v5
@@ -50,5 +49,5 @@ jobs:
5049
python-version: 3.12
5150
- uses: ./
5251
with:
53-
python-versions: "pypy-2.7, pypy-3.8, pypy-3.9, pypy-3.10, pypy-3.11, 3.6, 3.7, 3.8, 3.9, 3.10, 3.11, 3.12, 3.13, 3.14"
52+
python-versions: "pypy-2.7, pypy-3.8, pypy-3.9, pypy-3.10, pypy-3.11, 3.6, 3.7, 3.8, 3.9, 3.10, 3.11, 3.12, 3.13, 3.14, 3.13t, 3.14t"
5453
- run: nox --session github_actions_all_tests

tests/test_action_helper.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
"3.10": "3.10",
1212
"3.11": "3.11",
1313
"~3.12.0-0": "3.12",
14+
"3.13t": "3.13t",
15+
"3.13t-dev": "3.13t",
1416
"pypy-3.7": "3.7",
1517
"pypy-3.8-v7.3.9": "3.8",
1618
"pypy-3.9": "3.9",

0 commit comments

Comments
 (0)