File: cibw_test_command.sh

package info (click to toggle)
numpy 1%3A2.4.2%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 87,160 kB
  • sloc: python: 259,644; asm: 232,483; ansic: 213,962; cpp: 160,235; f90: 1,585; sh: 785; fortran: 567; makefile: 443; sed: 139; xml: 109; java: 97; perl: 82; cs: 62; javascript: 53; objc: 33; lex: 13; yacc: 9
file content (31 lines) | stat: -rw-r--r-- 1,414 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# This script is used by .github/workflows/wheels.yml to run the full test
# suite, and that the openblas version is correct.
set -xe

PROJECT_DIR="$1"

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

if [[ $RUNNER_OS == "Windows" && $IS_32_BIT == true ]] ; then
  # Avoid this in GHA: "ERROR: Found GNU link.exe instead of MSVC link.exe"
  rm /c/Program\ Files/Git/usr/bin/link.EXE
fi

# Set available memory value to avoid OOM problems on aarch64 (see gh-22418)
export NPY_AVAILABLE_MEM="4 GB"

FREE_THREADED_BUILD="$(python -c"import sysconfig; print(bool(sysconfig.get_config_var('Py_GIL_DISABLED')))")"
if [[ $FREE_THREADED_BUILD == "True" ]]; then
    # Manually check that importing NumPy does not re-enable the GIL.
    # In principle the tests should catch this but it seems harmless to leave it
    # here as a final sanity check before uploading broken wheels
    if [[ $(python -c "import numpy" 2>&1) == *"The global interpreter lock (GIL) has been enabled"* ]]; then
        echo "Error: Importing NumPy re-enables the GIL in the free-threaded build"
        exit 1
    fi
fi

# Run full tests with -n=auto. This makes pytest-xdist distribute tests across
# the available N CPU cores. Also print the durations for the 10 slowest tests
# to help with debugging slow or hanging tests
python -c "import sys; import numpy; sys.exit(not numpy.test(label='full', extra_argv=['-n=auto', '--durations=10']))"