Skip to content

Commit cd73d55

Browse files
committed
MAINT: improve Windows-specific code, pin delvewheel
Cleans up a Windows workaround in `cibw_test_commmand.sh` that is no longer needed.
1 parent 4040b7a commit cd73d55

File tree

4 files changed

+17
-12
lines changed

4 files changed

+17
-12
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
delvewheel==1.10.1 ; sys_platform == 'win32'

tools/wheels/cibw_before_build.sh

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ elif [ -z $INSTALL_OPENBLAS ]; then
2525
export INSTALL_OPENBLAS=true
2626
fi
2727

28-
# Install OpenBLAS from scipy-openblas64
28+
# Install OpenBLAS from scipy-openblas32|64
2929
if [[ "$INSTALL_OPENBLAS" = "true" ]] ; then
3030
# By default, use scipy-openblas64
3131
# On 32-bit platforms and on win-arm64, use scipy-openblas32
@@ -42,10 +42,20 @@ if [[ "$INSTALL_OPENBLAS" = "true" ]] ; then
4242
mkdir -p $PKG_CONFIG_PATH
4343
python -m pip install -r $PROJECT_DIR/requirements/openblas_requirements.txt
4444
python -c "import scipy_${OPENBLAS}; print(scipy_${OPENBLAS}.get_pkg_config())" > $PKG_CONFIG_PATH/scipy-openblas.pc
45+
46+
# Copy scipy-openblas DLL's to a fixed location so we can point delvewheel
47+
# at it in `repair_windows.sh` (needed only on Windows because of the lack
48+
# of RPATH support).
49+
if [[ $RUNNER_OS == "Windows" ]]; then
50+
python <<EOF
51+
import os, scipy_${OPENBLAS}, shutil
52+
srcdir = os.path.join(os.path.dirname(scipy_${OPENBLAS}.__file__), "lib")
53+
shutil.copytree(srcdir, os.path.join("$PKG_CONFIG_PATH", "lib"))
54+
EOF
55+
fi
4556
fi
4657

47-
# cibuildwheel doesn't install delvewheel by default (it does install
48-
# auditwheel on Linux and delocate on macOS)
58+
# cibuildwheel doesn't install delvewheel by default
4959
if [[ $RUNNER_OS == "Windows" ]]; then
50-
python -m pip install delvewheel
60+
python -m pip install -r $PROJECT_DIR/requirements/delvewheel_requirements.txt
5161
fi

tools/wheels/cibw_test_command.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@ PROJECT_DIR="$1"
66

77
python -c "import numpy; numpy.show_config()"
88

9-
if [[ $RUNNER_OS == "Windows" ]]; then
10-
# see gh-20391
11-
PY_DIR=$(python -c "import sys; print(sys.prefix)")
12-
mkdir $PY_DIR/libs
13-
fi
149
if [[ $RUNNER_OS == "macOS" && $RUNNER_ARCH == "X64" ]]; then
1510
# Not clear why this is needed but it seems on x86_64 this is not the default
1611
# and without it f2py tests fail
@@ -19,7 +14,6 @@ if [[ $RUNNER_OS == "macOS" && $RUNNER_ARCH == "X64" ]]; then
1914
# in f2py tests
2015
export LIBRARY_PATH="$LIBRARY_PATH:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib"
2116
elif [[ $RUNNER_OS == "Windows" && $IS_32_BIT == true ]] ; then
22-
echo "Skip OpenBLAS version check for 32-bit Windows, no OpenBLAS used"
2317
# Avoid this in GHA: "ERROR: Found GNU link.exe instead of MSVC link.exe"
2418
rm /c/Program\ Files/Git/usr/bin/link.EXE
2519
fi

tools/wheels/repair_windows.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ DEST_DIR="$2"
66
cwd=$PWD
77
cd $DEST_DIR
88

9-
# the libopenblas.dll is placed into this directory in the cibw_before_build
10-
# script.
9+
# The libopenblas_scipy DLL and the other DLLs it may need are placed into this
10+
# directory in `cibw_before_build.sh`.
1111
delvewheel repair --add-path $cwd/.openblas/lib -w $DEST_DIR $WHEEL

0 commit comments

Comments
 (0)