Skip to content

Commit c877175

Browse files
committed
Enable Python 3.15 / 3.15t for macOS wheel builds
Extend the opt-in preview Python versions (INCLUDE_PREVIEW_PYTHON_VERSIONS) to macOS arm64 so 3.15 / 3.15t are generated for macOS wheels, matching the Linux enablement. The interpreter setup (conda-forge python_dev/python_rc labels) is shared across OSes via .github/actions/setup-binary-builds. 3.15 / 3.15t are left out of MACOS_PYTHON_POINT_VERSIONS so they flow to that shared case as "3.15" / "3.15t" and resolve to the pinned conda-forge beta. The macOS base env ships a newer conda (>=26, required by its py3.14 base) that returns HTTP 400 downloading the 3.15 pre-release .conda from conda-forge label subchannels. For 3.15* on macOS, downgrade the base env and pin the older conda used on Linux/Windows, which downloads them correctly (same approach used for earlier macOS pre-release bring-ups). Also update the matrix unit tests (macOS arm64 now opts in). Authored with assistance from Claude Code (AI assistant).
1 parent c4a3250 commit c877175

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)