8
8
pool :
9
9
vmImage : ${{ parameters.vmImage }}
10
10
variables :
11
- BUILD_COMMIT : " v1.18.2 "
11
+ BUILD_COMMIT : " v1.18.3 "
12
12
NIGHTLY_BUILD_COMMIT : " master"
13
- NIGHTLY_BUILD : " false"
14
- PYTHON_ARCH : " x64"
15
13
JUNITXML : " test-data.xml"
16
14
TEST_DIR : ' $(Agent.WorkFolder)/tmp_for_test'
17
15
strategy :
24
22
- task : UsePythonVersion@0
25
23
inputs :
26
24
versionSpec : $(PYTHON_VERSION)
25
+ addToPath : true
27
26
architecture : $(PYTHON_ARCH)
28
27
displayName : Set python version
29
28
@@ -37,16 +36,11 @@ jobs:
37
36
displayName: Check that we have the expected version and architecture for Python
38
37
- bash : |
39
38
set -e
40
- SKIP_BUILD="false"
41
39
if [ "$BUILD_REASON" == "Schedule" ]; then
42
40
BUILD_COMMIT=$NIGHTLY_BUILD_COMMIT
43
- if [ "$NIGHTLY_BUILD" != "true" ]; then
44
- SKIP_BUILD="true"
45
- fi
46
41
fi
47
42
echo "Building numpy@$BUILD_COMMIT"
48
43
echo "##vso[task.setvariable variable=BUILD_COMMIT]$BUILD_COMMIT"
49
- echo "##vso[task.setvariable variable=SKIP_BUILD]$SKIP_BUILD"
50
44
# Store original Python path to be able to create test_venv pointing
51
45
# to same Python version.
52
46
PYTHON_EXE=`which python`
@@ -55,13 +49,18 @@ jobs:
55
49
- bash : |
56
50
set -e
57
51
cd numpy
52
+ git fetch origin HEAD
58
53
git checkout $BUILD_COMMIT
59
54
git clean -fxd
60
55
git reset --hard
61
56
displayName: Checkout numpy commit
62
- condition: eq(variables['SKIP_BUILD'], 'false')
57
+
58
+ - powershell : |
59
+ choco install -y mingw --forcex86 --force --version=5.3.0
60
+ displayName: 'Install 32-bit mingw for 32-bit builds'
61
+ condition: eq(variables['BITS'], 32)
63
62
- bash : |
64
- set -e
63
+ set -xe
65
64
pushd numpy
66
65
pip install twine wheel urllib3
67
66
# a bit overkill, all we really need is cython
@@ -70,65 +69,78 @@ jobs:
70
69
# handle license
71
70
cp ../LICENSE_win32.txt LICENSE.txt
72
71
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
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"
83
+ displayName: Prepare the build
78
84
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
+ }
79
92
# Build the wheel
93
+ pushd numpy
80
94
python setup.py build
81
95
python setup.py bdist_wheel
82
- ls dist
83
96
twine check dist/*
84
97
popd
85
98
displayName: Build wheel
86
- condition: eq(variables['SKIP_BUILD'], 'false')
87
99
- bash : |
88
100
set -ex
89
101
source extra_functions.sh
90
102
source config.sh
91
103
setup_test_venv
92
- pip install -r numpy/test_requirements.txt
93
- 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
94
108
run_tests
109
+ popd
95
110
teardown_test_venv
96
111
displayName: Install wheel and test
97
- condition: eq(variables['SKIP_BUILD'], 'false')
98
112
99
113
- bash : echo "##vso[task.prependpath]$CONDA/Scripts"
100
114
displayName : Add conda to PATH
101
- condition : and(succeeded(), eq(variables['SKIP_BUILD'], 'false'), ne(variables['Build.Reason'], 'PullRequest'))
102
115
103
116
- bash : conda install -q -y anaconda-client
104
117
displayName : Install anaconda-client
105
- condition : and(succeeded(), eq(variables['SKIP_BUILD'], 'false'), ne(variables['Build.Reason'], 'PullRequest'))
106
118
107
119
- bash : |
108
120
set -e
109
121
if [ "$BUILD_REASON" == "Schedule" ]; then
110
122
ANACONDA_ORG="scipy-wheels-nightly"
111
- TOKEN="$NUMPY_NIGHTLY_UPLOAD_TOKEN "
123
+ TOKEN="$MAPPED_NUMPY_NIGHTLY_UPLOAD_TOKEN "
112
124
else
113
125
ANACONDA_ORG="multibuild-wheels-staging"
114
- TOKEN="$NUMPY_STAGING_UPLOAD_TOKEN "
126
+ TOKEN="$MAPPED_NUMPY_STAGING_UPLOAD_TOKEN "
115
127
fi
116
128
if [ "$TOKEN" == "" ]; then
117
129
echo "##[warning] Could not find anaconda.org upload token in secret variables"
118
130
fi
119
131
echo "##vso[task.setvariable variable=TOKEN]$TOKEN"
120
132
echo "##vso[task.setvariable variable=ANACONDA_ORG]$ANACONDA_ORG"
121
133
displayName: Retrieve secret upload token
122
- condition: and(succeeded(), eq(variables['SKIP_BUILD'], 'false'), ne(variables['Build.Reason'], 'PullRequest'))
123
134
env:
124
135
# Secret variables need to mapped to env variables explicitly:
125
- NUMPY_NIGHTLY_UPLOAD_TOKEN: $(NUMPY_NIGHTLY_UPLOAD_TOKEN)
126
- NUMPY_STAGING_UPLOAD_TOKEN: $(NUMPY_STAGING_UPLOAD_TOKEN)
136
+ MAPPED_NUMPY_NIGHTLY_UPLOAD_TOKEN: $(NUMPY_NIGHTLY_UPLOAD_TOKEN)
137
+ MAPPED_NUMPY_STAGING_UPLOAD_TOKEN: $(NUMPY_STAGING_UPLOAD_TOKEN)
138
+
127
139
- bash : |
128
140
set -e
129
141
# The --force option forces a replacement if the remote file already
130
142
# exists.
131
- ls numpy/dist/numpy-*.whl
143
+ echo uploading numpy/dist/numpy-*.whl
132
144
anaconda -t $TOKEN upload --force -u $ANACONDA_ORG numpy/dist/numpy-*.whl
133
145
echo "PyPI-style index: https://pypi.anaconda.org/$ANACONDA_ORG/simple"
134
146
displayName: Upload to anaconda.org (only if secret token is retrieved)
0 commit comments