Skip to content

Commit 11056ed

Browse files
committed
Install cp315 numpy from the nightly index instead of building from source
PyPI publishes no cp315/cp315t numpy wheels, so `pip install numpy` in the smoke-test step falls back to a source build. That is merely slow on Linux and macOS, but a hard failure on Windows: numpy/_core/src/common/simd/simd.h(4): fatal error C1083: Cannot open include file: 'stdalign.h': No such file or directory error: metadata-generation-failed download.pytorch.org/whl/nightly carries preview cp315 and cp315t numpy wheels for every platform (manylinux x86_64/aarch64, macosx arm64/x86_64, win_amd64), so pull numpy from there for 3.15 and forbid a source fallback with --only-binary=:all:. Other python versions keep using PyPI unchanged.
1 parent 74c0c77 commit 11056ed

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

.github/scripts/validate_binaries.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,19 @@ run_smoke_tests() {
200200

201201
# For pip install also test with latest numpy
202202
if [[ ${MATRIX_PACKAGE_TYPE} == 'wheel' ]]; then
203-
pip3 install numpy --upgrade --force-reinstall
203+
# PyPI publishes no cp315/cp315t numpy wheels, so a plain
204+
# `pip install numpy` falls back to building from source: slow on Linux
205+
# and macOS, and a hard failure on Windows, where MSVC cannot find
206+
# stdalign.h ("fatal error C1083") while compiling numpy's SIMD headers.
207+
# Preview wheels for every platform, Windows included, are on the
208+
# nightly index -- take those instead, and never a source build.
209+
if [[ ${MATRIX_PYTHON_VERSION} == "3.15" || ${MATRIX_PYTHON_VERSION} == "3.15t" ]]; then
210+
pip3 install --pre numpy --upgrade --force-reinstall \
211+
--only-binary=:all: \
212+
--index-url https://download.pytorch.org/whl/nightly
213+
else
214+
pip3 install numpy --upgrade --force-reinstall
215+
fi
204216
${PYTHON_RUN} ./smoke_test/smoke_test.py ${test_suffix} ${compile_check}
205217
fi
206218

0 commit comments

Comments
 (0)