Skip to content

Commit fd65731

Browse files
authored
Enable Python 3.15 / 3.15t for macOS wheel builds (#8358)
Enables opt-in Python 3.15 / 3.15t for **macOS arm64** wheel builds, mirroring the Linux enablement in #8148. - Extends the `INCLUDE_PREVIEW_PYTHON_VERSIONS` per-OS gate in `generate_binary_build_matrix.py` to include macOS arm64. 3.15/3.15t are intentionally left out of `MACOS_PYTHON_POINT_VERSIONS` so they flow to the shared conda case as `3.15`/`3.15t` and resolve to the pinned conda-forge beta. - Skips the macOS smoke test for 3.15/3.15t (runtime deps lack cp315 wheels). - Updates the matrix unit tests (macOS arm64 now opts in). - Includes a temporary `[DO NOT MERGE]` commit forcing PR builds to 3.15/3.15t on macOS for CI validation; drop before merging. **Depends on #8148** (the shared conda-forge 3.15 interpreter setup in `setup-binary-builds`); stacked on it, will shrink once #8148 lands. Follow-up: wire `include-preview-python-versions: enable` into the macOS validate workflow for full nightly coverage. Authored with assistance from Claude Code (AI assistant). Co-authored-by: Andrey Talman <atalman@users.noreply.github.com>
1 parent c4a3250 commit fd65731

3 files changed

Lines changed: 27 additions & 15 deletions

File tree

.github/actions/setup-binary-builds/action.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,13 @@ runs:
138138
# untouched.
139139
if [[ "${RUNNER_OS}" != "macOS" ]]; then
140140
conda install -y conda=25.3.0
141+
elif [[ "${PYTHON_VERSION}" == 3.15* ]]; then
142+
# Newer macOS base conda 400s on the 3.15 label download; pin an older one.
143+
conda install -y python=3.11
144+
if [[ -n "$(conda list | grep conda-anaconda-telemetry)" ]]; then
145+
conda uninstall -y conda-anaconda-telemetry conda-anaconda-tos
146+
fi
147+
conda install -y conda=24.7.1 conda-libmamba-solver=24.1.0
141148
fi
142149
143150
# Pin openssl=3.5.6 by default: openssl 3.5.7 regressed ASN.1 parsing

tools/scripts/generate_binary_build_matrix.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -448,15 +448,21 @@ def generate_wheels_matrix(
448448
) -> List[Dict[str, str]]:
449449
package_type = "wheel"
450450

451+
explicitly_requested_versions = bool(python_versions)
452+
451453
if not python_versions:
452454
# Define default python version
453455
python_versions = list(PYTHON_ARCHES)
454456

455457
# Opt-in preview versions (e.g. 3.15/3.15t) are torch-only and validated
456-
# on Linux x86 and aarch64 only. Append them to the default list so the
457-
# shared default (used by domain libraries, Windows and macOS) is
458+
# on Linux x86/aarch64 and macOS arm64. Append them to the default list
459+
# so the shared default (used by domain libraries and Windows) is
458460
# unaffected.
459-
if include_preview_python_versions and os in (LINUX, LINUX_AARCH64):
461+
if include_preview_python_versions and os in (
462+
LINUX,
463+
LINUX_AARCH64,
464+
MACOS_ARM64,
465+
):
460466
python_versions += PREVIEW_PYTHON_ARCHES_DICT.get(channel, [])
461467

462468
if os == WINDOWS_ARM64:

tools/tests/test_generate_binary_build_matrix.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,11 @@ def _test_channel_python_versions(
149149
)
150150
return {entry["python_version"] for entry in out["include"]}
151151

152-
def test_preview_python_versions_opt_in_on_linux(self):
153-
# 3.15 / 3.15t are validated on Linux x86 and aarch64 for the nightly and
154-
# test channels when explicitly opted in.
152+
def test_preview_python_versions_opt_in(self):
153+
# 3.15 / 3.15t are validated on Linux x86/aarch64 and macOS arm64 for the
154+
# nightly and test channels when explicitly opted in.
155155
for channel in ("nightly", "test"):
156-
for operating_system in ("linux", "linux-aarch64"):
156+
for operating_system in ("linux", "linux-aarch64", "macos-arm64"):
157157
versions = self._test_channel_python_versions(
158158
operating_system, include_preview="enable", channel=channel
159159
)
@@ -167,14 +167,13 @@ def test_preview_python_versions_off_by_default(self):
167167
self.assertNotIn("3.15", versions)
168168
self.assertNotIn("3.15t", versions)
169169

170-
def test_preview_python_versions_excluded_on_non_linux(self):
171-
# Windows and macOS must not pick up the preview versions even when opted in.
172-
for operating_system in ("windows", "macos"):
173-
versions = self._test_channel_python_versions(
174-
operating_system, include_preview="enable"
175-
)
176-
self.assertNotIn("3.15", versions)
177-
self.assertNotIn("3.15t", versions)
170+
def test_preview_python_versions_excluded_on_windows(self):
171+
# Windows must not pick up the preview versions even when opted in.
172+
versions = self._test_channel_python_versions(
173+
"windows", include_preview="enable"
174+
)
175+
self.assertNotIn("3.15", versions)
176+
self.assertNotIn("3.15t", versions)
178177

179178
def test_preview_python_versions_excluded_on_release_channel(self):
180179
# Preview versions are defined for the nightly and test channels only,

0 commit comments

Comments
 (0)