8
8
pool :
9
9
vmImage : ${{ parameters.vmImage }}
10
10
variables :
11
- BUILD_COMMIT : " v1.18.2 "
11
+ BUILD_COMMIT : " master "
12
12
NIGHTLY_BUILD_COMMIT : " master"
13
13
JUNITXML : " test-data.xml"
14
14
TEST_DIR : ' $(Agent.WorkFolder)/tmp_for_test'
@@ -36,16 +36,11 @@ jobs:
36
36
displayName: Check that we have the expected version and architecture for Python
37
37
- bash : |
38
38
set -e
39
- SKIP_BUILD="false"
40
39
if [ "$BUILD_REASON" == "Schedule" ]; then
41
40
BUILD_COMMIT=$NIGHTLY_BUILD_COMMIT
42
- if [ "$NIGHTLY_BUILD" != "true" ]; then
43
- SKIP_BUILD="true"
44
- fi
45
41
fi
46
42
echo "Building numpy@$BUILD_COMMIT"
47
43
echo "##vso[task.setvariable variable=BUILD_COMMIT]$BUILD_COMMIT"
48
- echo "##vso[task.setvariable variable=SKIP_BUILD]$SKIP_BUILD"
49
44
# Store original Python path to be able to create test_venv pointing
50
45
# to same Python version.
51
46
PYTHON_EXE=`which python`
@@ -54,68 +49,72 @@ jobs:
54
49
- bash : |
55
50
set -e
56
51
cd numpy
52
+ git fetch origin HEAD
57
53
git checkout $BUILD_COMMIT
58
54
git clean -fxd
59
55
git reset --hard
60
56
displayName: Checkout numpy commit
61
- condition: eq(variables['SKIP_BUILD'], 'false')
62
57
63
58
- powershell : |
64
59
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
60
displayName: 'Install 32-bit mingw for 32-bit builds'
70
61
condition: eq(variables['BITS'], 32)
71
- - powershell : |
62
+ - bash : |
63
+ set -xe
64
+ pushd numpy
72
65
pip install twine wheel urllib3
73
66
# a bit overkill, all we really need is cython
74
- pip install --timeout=60 -r numpy/ test_requirements.txt
67
+ pip install --timeout=60 -r test_requirements.txt
75
68
76
69
# handle license
77
- cp LICENSE_win32.txt numpy/ LICENSE.txt
70
+ cp ../ LICENSE_win32.txt LICENSE.txt
78
71
79
- # Download and copy static "openblas.a", put it into LIB
80
- $libdir = Join-Path $PSScriptRoot "OPENBLAS_LIB"
81
- mkdir $libdir
82
- $openblas_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
72
+ # handle _distributor_init.py
73
+ PYTHONPATH=tools python -c "import openblas_support; openblas_support.make_init('numpy')"
74
+
75
+ # Download and get the path to "openblas.a". We cannot copy it
76
+ # to $PYTHON_EXE's directory since that is on a different drive which
77
+ # mingw does not like. Instead copy it to a directory and set OPENBLAS
78
+ target=$(python tools/openblas_support.py)
79
+ mkdir -p openblas
80
+ echo Copying $target to openblas
81
+ cp $target openblas
82
+ echo "##vso[task.setvariable variable=OPENBLAS]openblas"
86
83
displayName: Prepare the build
87
- condition: eq(variables['SKIP_BUILD'], 'false')
88
84
89
- - bash : |
85
+ - powershell : |
86
+ If ($(BITS) -eq 32) {
87
+ $env:CFLAGS = "-m32"
88
+ $env:LDFLAGS = "-m32"
89
+ $env:PATH = "C:\\tools\\mingw32\\bin;" + $env:PATH
90
+ refreshenv
91
+ }
90
92
# Build the wheel
91
- set -e
92
93
pushd numpy
93
94
python setup.py build
94
95
python setup.py bdist_wheel
95
- ls dist
96
96
twine check dist/*
97
97
popd
98
98
displayName: Build wheel
99
- condition: eq(variables['SKIP_BUILD'], 'false')
100
99
- bash : |
101
100
set -ex
102
101
source extra_functions.sh
103
102
source config.sh
104
103
setup_test_venv
105
- pip install -r numpy/test_requirements.txt
106
- pip install numpy/dist/numpy-*.whl
104
+ python -m pip install -r numpy/test_requirements.txt
105
+ python -m pip install numpy/dist/numpy-*.whl
106
+ mkdir -p for_test
107
+ pushd for_test
107
108
run_tests
109
+ popd
108
110
teardown_test_venv
109
111
displayName: Install wheel and test
110
- condition: eq(variables['SKIP_BUILD'], 'false')
111
-
112
- - bash : echo "##vso[task.prependpath]$CONDA/Scripts"
113
- displayName : Add conda to PATH
114
- condition : and(succeeded(), eq(variables['SKIP_BUILD'], 'false'), ne(variables['Build.Reason'], 'PullRequest'))
115
112
116
- - bash : conda install -q -y anaconda-client
113
+ - bash : |
114
+ set -ex
115
+ echo "##vso[task.prependpath]$CONDA/Scripts"
116
+ conda install -q -y anaconda-client
117
117
displayName: Install anaconda-client
118
- condition : and(succeeded(), eq(variables['SKIP_BUILD'], 'false'), ne(variables['Build.Reason'], 'PullRequest'))
119
118
120
119
- bash : |
121
120
set -e
@@ -132,7 +131,6 @@ jobs:
132
131
echo "##vso[task.setvariable variable=TOKEN]$TOKEN"
133
132
echo "##vso[task.setvariable variable=ANACONDA_ORG]$ANACONDA_ORG"
134
133
displayName: Retrieve secret upload token
135
- condition: and(succeeded(), eq(variables['SKIP_BUILD'], 'false'), ne(variables['Build.Reason'], 'PullRequest'))
136
134
env:
137
135
# Secret variables need to mapped to env variables explicitly:
138
136
NUMPY_NIGHTLY_UPLOAD_TOKEN: $(NUMPY_NIGHTLY_UPLOAD_TOKEN)
0 commit comments