Skip to content

Commit c20124b

Browse files
committed
Fix Python 3.15 smoke tests on Windows and Linux
numpy does not publish cp315 wheels on PyPI, so installing a freshly built wheel under 3.15 / 3.15t falls back to the numpy sdist and tries to build it from source. On Windows that build fails outright in the conda env (meson: "Cython requires python3 dependency for link testing"), so the wheel is never installed and the smoke test reports ModuleNotFoundError. cp315 wheels for both numpy and pillow are published on download.pytorch.org across cpu / cu126 / cu128 / cu129 / cu130 / xpu, so for 3.15 / 3.15t resolve runtime deps from there with --pre (numpy is 2.6.0.dev0). All other Python versions keep installing from PyPI unchanged. Windows: applies to both the X64 and ARM64 smoke tests. Linux: re-enables the smoke test for 3.15, which was skipped for this exact reason, and applies the same dependency resolution. The binary-build-matrix changes from the earlier revision of this PR are dropped: #8427 has since enabled 3.15 / 3.15t by default for every OS and removed the opt-in preview mechanism they were built on.
1 parent 83b2d68 commit c20124b

2 files changed

Lines changed: 27 additions & 9 deletions

File tree

.github/workflows/build_wheels_linux.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -301,12 +301,7 @@ jobs:
301301
repository: ${{ inputs.repository }}
302302
script: ${{ inputs.post-script }}
303303
- name: Smoke Test
304-
# Skip the smoke test for Python 3.15 / 3.15t: the wheel builds fine, but
305-
# the smoke test installs the wheel which pulls required runtime deps
306-
# (e.g. pillow, a hard torchvision dependency) that have no cp315 wheels
307-
# yet and fail to build from sdist. Re-enable once the ecosystem ships
308-
# cp315 wheels.
309-
if: ${{ inputs.run-smoke-test && ! startsWith(matrix.python_version, '3.15') }}
304+
if: ${{ inputs.run-smoke-test }}
310305
shell: bash -l {0}
311306
env:
312307
PACKAGE_NAME: ${{ inputs.package-name }}
@@ -317,7 +312,15 @@ jobs:
317312
WHEEL_NAME=$(ls "${{ inputs.repository }}/dist/")
318313
echo "$WHEEL_NAME"
319314
320-
${CONDA_RUN} pip install "${{ inputs.repository }}/dist/$WHEEL_NAME"
315+
# numpy does not publish cp315 wheels on PyPI yet; they are available on
316+
# download.pytorch.org as a pre-release. For 3.15 / 3.15t resolve runtime
317+
# deps from there and allow pre-releases. Other versions use PyPI as before.
318+
if [[ "${{ startsWith(matrix.python_version, '3.15') }}" == "true" ]]; then
319+
${CONDA_RUN} pip install --pre "${{ inputs.repository }}/dist/$WHEEL_NAME" \
320+
--index-url "https://download.pytorch.org/whl/${CHANNEL}/${CU_VERSION}"
321+
else
322+
${CONDA_RUN} pip install "${{ inputs.repository }}/dist/$WHEEL_NAME"
323+
fi
321324
# Checking that we have a pinned version of torch in our dependency tree
322325
(
323326
pushd "${RUNNER_TEMP}"

.github/workflows/build_wheels_windows.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,15 @@ jobs:
362362
source "${BUILD_ENV_FILE}"
363363
WHEEL_NAME=$(ls "${{ inputs.repository }}/dist/")
364364
echo "$WHEEL_NAME"
365-
${CONDA_RUN} pip install "${{ inputs.repository }}/dist/$WHEEL_NAME"
365+
# numpy does not publish cp315 wheels on PyPI yet; they are available on
366+
# download.pytorch.org as a pre-release. For 3.15 / 3.15t resolve runtime
367+
# deps from there and allow pre-releases. Other versions use PyPI as before.
368+
if [[ "${{ startsWith(matrix.python_version, '3.15') }}" == "true" ]]; then
369+
${CONDA_RUN} pip install --pre "${{ inputs.repository }}/dist/$WHEEL_NAME" \
370+
--index-url "https://download.pytorch.org/whl/${CHANNEL}/${CU_VERSION}"
371+
else
372+
${CONDA_RUN} pip install "${{ inputs.repository }}/dist/$WHEEL_NAME"
373+
fi
366374
if [[ ! -f "${{ inputs.repository }}"/${SMOKE_TEST_SCRIPT} ]]; then
367375
echo "${{ inputs.repository }}/${SMOKE_TEST_SCRIPT} not found"
368376
${CONDA_RUN} "${{ inputs.repository }}/${ENV_SCRIPT}" python -c "import ${PACKAGE_NAME}; print('package version is ', ${PACKAGE_NAME}.__version__)"
@@ -380,7 +388,14 @@ jobs:
380388
cd $SRC_DIR
381389
source .venv/Scripts/activate
382390
whl=$(find dist -name "${{env.PACKAGE_NAME}}-*.whl" | head -n 1)
383-
pip install $whl
391+
# See the X64 smoke test above: for 3.15 / 3.15t numpy ships only on
392+
# download.pytorch.org, as a pre-release.
393+
if [[ "${{ startsWith(matrix.python_version, '3.15') }}" == "true" ]]; then
394+
pip install --pre "$whl" \
395+
--index-url "https://download.pytorch.org/whl/${CHANNEL}/${CU_VERSION}"
396+
else
397+
pip install "$whl"
398+
fi
384399
385400
if [[ ! -f ${SMOKE_TEST_SCRIPT} ]]; then
386401
echo "${SMOKE_TEST_SCRIPT} not found"

0 commit comments

Comments
 (0)