Skip to content

Commit b2cfdac

Browse files
committed
minor cleanups
1 parent 88bf630 commit b2cfdac

File tree

3 files changed

+19
-27
lines changed

3 files changed

+19
-27
lines changed

cibuildwheel.toml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
[tool.cibuildwheel]
22
# Note: the below skip command doesn't do much currently, the platforms to
3-
# build wheels for in CI are controlled in `.github/workflows/wheels.yml` and
4-
# `tools/ci/cirrus_wheels.yml`.
5-
build-frontend = "build"
3+
# build wheels for in CI are controlled in `.github/workflows/wheels.yml`.
64
skip = ["*_i686", "*_ppc64le", "*_s390x", "*_universal2"]
75
before-build = "bash {project}/tools/wheels/cibw_before_build.sh {project}"
86
before-test = "pip install -r {project}/requirements/wheel_test_requirements.txt"
@@ -21,16 +19,15 @@ musllinux-x86_64-image = "musllinux_1_2"
2119
musllinux-aarch64-image = "musllinux_1_2"
2220

2321
[tool.cibuildwheel.linux.environment]
24-
# RUNNER_OS is a GitHub Actions specific env var; define it here so it works on Cirrus CI too
22+
# RUNNER_OS is a GitHub Actions specific env var; define it here so it's
23+
# defined when running cibuildwheel locally
2524
RUNNER_OS="Linux"
26-
# /project will be the $PWD equivalent inside the docker used to build the wheel
25+
# /project will be the $PWD equivalent inside the Docker container used to build the wheel
2726
PKG_CONFIG_PATH="/project/.openblas"
2827
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/project/.openblas/lib"
2928

3029
[tool.cibuildwheel.macos]
3130
# universal2 wheels are not supported (see gh-21233), use `delocate-fuse` if you need them
32-
# note that universal2 wheels are not built, they're listed in the tool.cibuildwheel.skip
33-
# section
3431
# Not clear why the DYLD_LIBRARY_PATH is not passed through from the environment
3532
repair-wheel-command = [
3633
"export DYLD_LIBRARY_PATH=$PWD/.openblas/lib",
@@ -41,8 +38,6 @@ repair-wheel-command = [
4138
[tool.cibuildwheel.windows]
4239
config-settings = {setup-args = ["--vsenv", "-Dallow-noblas=false"], build-dir="build"}
4340
repair-wheel-command = "bash -el ./tools/wheels/repair_windows.sh {wheel} {dest_dir}"
44-
# This does not work, use CIBW_ENVIRONMENT_WINDOWS
45-
environment = {PKG_CONFIG_PATH="./.openblas"}
4641

4742
[[tool.cibuildwheel.overrides]]
4843
select = ["*-win32"]

tools/wheels/cibw_before_build.sh

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ PROJECT_DIR="${1:-$PWD}"
44
NUMPY_SRC_DIR="${1:-$PWD}/numpy-src"
55

66

7-
# remove any cruft from a previous run
8-
rm -rf build
9-
107
# Update license
118
echo "" >> $NUMPY_SRC_DIR/LICENSE.txt
129
echo "----" >> $NUMPY_SRC_DIR/LICENSE.txt
@@ -28,29 +25,25 @@ elif [ -z $INSTALL_OPENBLAS ]; then
2825
export INSTALL_OPENBLAS=true
2926
fi
3027

31-
# Install Openblas from scipy-openblas64
28+
# Install OpenBLAS from scipy-openblas64
3229
if [[ "$INSTALL_OPENBLAS" = "true" ]] ; then
33-
# by default, use scipy-openblas64
30+
# By default, use scipy-openblas64
31+
# On 32-bit platforms and on win-arm64, use scipy-openblas32
3432
OPENBLAS=openblas64
35-
# Possible values for RUNNER_ARCH in github are
36-
# X86, X64, ARM, or ARM64
37-
# TODO: should we detect a missing RUNNER_ARCH and use platform.machine()
38-
# when wheel build is run outside github?
39-
# On 32-bit platforms, use scipy_openblas32
40-
# On win-arm64 use scipy_openblas32
33+
# Possible values for RUNNER_ARCH in GitHub Actions are: X86, X64, ARM, or ARM64
4134
if [[ $RUNNER_ARCH == "X86" || $RUNNER_ARCH == "ARM" ]] ; then
4235
OPENBLAS=openblas32
4336
elif [[ $RUNNER_ARCH == "ARM64" && $RUNNER_OS == "Windows" ]] ; then
4437
OPENBLAS=openblas32
4538
fi
46-
echo PKG_CONFIG_PATH is $PKG_CONFIG_PATH, OPENBLAS is ${OPENBLAS}
4739
PKG_CONFIG_PATH=$PROJECT_DIR/.openblas
40+
echo PKG_CONFIG_PATH is $PKG_CONFIG_PATH, OPENBLAS is ${OPENBLAS}
4841
rm -rf $PKG_CONFIG_PATH
4942
mkdir -p $PKG_CONFIG_PATH
5043
python -m pip install -r $PROJECT_DIR/requirements/openblas_requirements.txt
5144
python -c "import scipy_${OPENBLAS}; print(scipy_${OPENBLAS}.get_pkg_config())" > $PKG_CONFIG_PATH/scipy-openblas.pc
5245
# Copy the shared objects to a path under $PKG_CONFIG_PATH, the build
53-
# will point $LD_LIBRARY_PATH there and then auditwheel/delocate-wheel will
46+
# will point $LD_LIBRARY_PATH there and then auditwheel/delocate will
5447
# pull these into the wheel. Use python to avoid windows/posix problems
5548
python <<EOF
5649
import os, scipy_${OPENBLAS}, shutil
@@ -62,7 +55,9 @@ if os.path.exists(srcdir): # macosx delocate
6255
EOF
6356
# pkg-config scipy-openblas --print-provides
6457
fi
58+
59+
# cibuildwheel doesn't install delvewheel by default (it does install
60+
# auditwheel on Linux and delocate on macOS)
6561
if [[ $RUNNER_OS == "Windows" ]]; then
66-
# delvewheel is the equivalent of delocate/auditwheel for windows.
67-
python -m pip install delvewheel wheel
62+
python -m pip install delvewheel
6863
fi

tools/wheels/cibw_test_command.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ PROJECT_DIR="$1"
77
python -c "import numpy; numpy.show_config()"
88

99
if [[ $RUNNER_OS == "Windows" ]]; then
10-
# GH 20391
10+
# see gh-20391
1111
PY_DIR=$(python -c "import sys; print(sys.prefix)")
1212
mkdir $PY_DIR/libs
1313
fi
@@ -23,8 +23,8 @@ elif [[ $RUNNER_OS == "Windows" && $IS_32_BIT == true ]] ; then
2323
# Avoid this in GHA: "ERROR: Found GNU link.exe instead of MSVC link.exe"
2424
rm /c/Program\ Files/Git/usr/bin/link.EXE
2525
fi
26-
# Set available memory value to avoid OOM problems on aarch64.
27-
# See gh-22418.
26+
27+
# Set available memory value to avoid OOM problems on aarch64 (see gh-22418)
2828
export NPY_AVAILABLE_MEM="4 GB"
2929

3030
FREE_THREADED_BUILD="$(python -c"import sysconfig; print(bool(sysconfig.get_config_var('Py_GIL_DISABLED')))")"
@@ -42,4 +42,6 @@ fi
4242
# the available N CPU cores. Also print the durations for the 10 slowest tests
4343
# to help with debugging slow or hanging tests
4444
python -c "import sys; import numpy; sys.exit(not numpy.test(label='full', extra_argv=['-n=auto', '--durations=10']))"
45+
46+
# Check license file content
4547
python $PROJECT_DIR/tools/wheels/check_license.py

0 commit comments

Comments
 (0)