Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit 39d9347

Browse files
committed
copy bits from the numpy azure configuration for windows, fix run_tests
1 parent 6cb4519 commit 39d9347

File tree

3 files changed

+37
-15
lines changed

3 files changed

+37
-15
lines changed

azure-pipelines.yml

+9
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,31 @@ jobs:
2222
py_3.6_32:
2323
PYTHON_VERSION: "3.6.x"
2424
PYTHON_ARCH: "x86"
25+
BITS: 32
2526
py_3.6_64:
2627
PYTHON_VERSION: "3.6.x"
28+
PYTHON_ARCH: 'x64'
29+
BITS: 64
2730
py_3.7_32:
2831
PYTHON_VERSION: "3.7.x"
2932
PYTHON_ARCH: "x86"
3033
NIGHTLY_BUILD: "true"
34+
BITS: 32
3135
py_3.7_64:
3236
PYTHON_VERSION: "3.7.x"
3337
NIGHTLY_BUILD: "true"
38+
PYTHON_ARCH: 'x64'
39+
BITS: 64
3440
py_3.8_32:
3541
PYTHON_VERSION: "3.8.x"
3642
PYTHON_ARCH: "x86"
3743
NIGHTLY_BUILD: "true"
44+
BITS: 32
3845
py_3.8_64:
3946
PYTHON_VERSION: "3.8.x"
4047
NIGHTLY_BUILD: "true"
48+
PYTHON_ARCH: 'x64'
49+
BITS: 64
4150

4251
- template: azure/posix.yml
4352
parameters:

azure/windows.yml

+25-12
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ jobs:
1010
variables:
1111
BUILD_COMMIT: "v1.18.2"
1212
NIGHTLY_BUILD_COMMIT: "master"
13-
NIGHTLY_BUILD: "false"
14-
PYTHON_ARCH: "x64"
1513
JUNITXML: "test-data.xml"
1614
TEST_DIR: '$(Agent.WorkFolder)/tmp_for_test'
1715
strategy:
@@ -24,6 +22,7 @@ jobs:
2422
- task: UsePythonVersion@0
2523
inputs:
2624
versionSpec: $(PYTHON_VERSION)
25+
addToPath: true
2726
architecture: $(PYTHON_ARCH)
2827
displayName: Set python version
2928

@@ -60,23 +59,37 @@ jobs:
6059
git reset --hard
6160
displayName: Checkout numpy commit
6261
condition: eq(variables['SKIP_BUILD'], 'false')
63-
- bash: |
64-
set -e
65-
pushd numpy
62+
63+
- powershell: |
64+
choco install -y mingw --forcex86 --force --version=5.3.0
65+
$env:CFLAGS = "-m32"
66+
$env:LDFLAGS = "-m32"
67+
$env:PATH = "C:\\tools\\mingw32\\bin;" + $env:PATH
68+
refreshenv
69+
displayName: 'Install 32-bit mingw for 32-bit builds'
70+
condition: eq(variables['BITS'], 32)
71+
- powershell: |
6672
pip install twine wheel urllib3
6773
# a bit overkill, all we really need is cython
68-
pip install --timeout=60 -r test_requirements.txt
74+
pip install --timeout=60 -r numpy/test_requirements.txt
6975
7076
# handle license
71-
cp ../LICENSE_win32.txt LICENSE.txt
77+
cp LICENSE_win32.txt numpy/LICENSE.txt
7278
73-
# Download and install static "openblas.a" to PYTHON/lib
74-
PYTHON_DIR=$(python -c"import sys, os; print(os.path.dirname(sys.executable))")
75-
LIB=$(python tools/openblas_support.py)
76-
echo Copying $LIB to $PYTHON_DIR/lib
77-
cp $LIB $PYTHON_DIR/lib/openblas.a
79+
# Download and copy static "openblas.a", put it into LIB
80+
$libdir = Join-Path $PSScriptRoot "OPENBLAS_LIB"
81+
mkdir $libdir
82+
openblase_lib=$( python numpy/tools/openblas_support.py )
83+
echo Copying $openblas_lib to $libdir
84+
cp $openblas_lib $libdir/openblas.a
85+
$env:LIB = $libdir + ";" + $env:LIB
86+
displayName: Prepare the build
87+
condition: eq(variables['SKIP_BUILD'], 'false')
7888
89+
- bash: |
7990
# Build the wheel
91+
set -e
92+
pushd numpy
8093
python setup.py build
8194
python setup.py bdist_wheel
8295
ls dist

config.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ function run_tests {
4141
if [ -n "$IS_LINUX" ]; then
4242
apt-get -y update && apt-get install -y gfortran
4343
fi
44-
python -c "$(get_test_cmd)"
44+
$PYTHON_EXE -c "$(get_test_cmd)"
4545
# Check bundled license file
46-
python ../check_license.py
46+
$PYTHON_EXE ../check_license.py
4747
# Show BLAS / LAPACK used. Since this uses a wheel we cannot use
4848
# tools/openblas_config.py; tools is not part of what is shipped
49-
python -c 'import numpy; numpy.show_config()'
49+
$PYTHON_EXE -c 'import numpy; numpy.show_config()'
5050
}

0 commit comments

Comments
 (0)