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

Commit 3b74aa4

Browse files
committed
reuse numpy azure configuration for windows, cleanups
1 parent 6cb4519 commit 3b74aa4

File tree

6 files changed

+76
-65
lines changed

6 files changed

+76
-65
lines changed

.appveyor.yml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
image: Ubuntu
2+
3+
install:
4+
- echo done
5+
6+
test_script:
7+
- echo done
8+
9+
build: off
10+

azure-pipelines.yml

+11-15
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
schedules:
22
- cron: "27 3 */1 * *"
33
# 3:27am UTC everyday
4-
displayName: Nighthly build
4+
displayName: Nightly build
55
branches:
66
include:
77
- master
@@ -22,27 +22,32 @@ 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"
30-
NIGHTLY_BUILD: "true"
33+
BITS: 32
3134
py_3.7_64:
3235
PYTHON_VERSION: "3.7.x"
33-
NIGHTLY_BUILD: "true"
36+
PYTHON_ARCH: 'x64'
37+
BITS: 64
3438
py_3.8_32:
3539
PYTHON_VERSION: "3.8.x"
3640
PYTHON_ARCH: "x86"
37-
NIGHTLY_BUILD: "true"
41+
BITS: 32
3842
py_3.8_64:
3943
PYTHON_VERSION: "3.8.x"
40-
NIGHTLY_BUILD: "true"
44+
PYTHON_ARCH: 'x64'
45+
BITS: 64
4146

4247
- template: azure/posix.yml
4348
parameters:
4449
name: linux
45-
vmImage: ubuntu-16.04
50+
vmImage: ubuntu-18.04
4651
matrix:
4752
py_3.6_32:
4853
MB_PYTHON_VERSION: "3.6"
@@ -56,24 +61,20 @@ jobs:
5661
py_3.7_32:
5762
MB_PYTHON_VERSION: "3.7"
5863
PLAT: "i686"
59-
NIGHTLY_BUILD: "true"
6064
MB_ML_VER: "2010"
6165
ENV_VARS_PATH: "env_vars_32.sh"
6266
DOCKER_TEST_IMAGE: "multibuild/xenial_{PLAT}"
6367
py_3.7_64:
6468
MB_PYTHON_VERSION: "3.7"
65-
NIGHTLY_BUILD: "true"
6669
MB_ML_VER: "2010"
6770
py_3.8_32:
6871
MB_PYTHON_VERSION: "3.8"
6972
PLAT: "i686"
70-
NIGHTLY_BUILD: "true"
7173
MB_ML_VER: "2010"
7274
ENV_VARS_PATH: "env_vars_32.sh"
7375
DOCKER_TEST_IMAGE: "multibuild/xenial_{PLAT}"
7476
py_3.8_64:
7577
MB_PYTHON_VERSION: "3.8"
76-
NIGHTLY_BUILD: "true"
7778
MB_ML_VER: "2010"
7879

7980
- template: azure/posix.yml
@@ -83,12 +84,7 @@ jobs:
8384
matrix:
8485
py_3.6_64:
8586
MB_PYTHON_VERSION: "3.6"
86-
MB_PYTHON_OSX_VER: 10.9
8787
py_3.7_64:
8888
MB_PYTHON_VERSION: "3.7"
89-
NIGHTLY_BUILD: "true"
90-
MB_PYTHON_OSX_VER: 10.9
9189
py_3.8_64:
9290
MB_PYTHON_VERSION: "3.8"
93-
NIGHTLY_BUILD: "true"
94-
MB_PYTHON_OSX_VER: 10.9

azure/posix.yml

+8-18
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@ jobs:
99
vmImage: ${{ parameters.vmImage }}
1010
variables:
1111
REPO_DIR: "numpy"
12-
BUILD_COMMIT: "master"
12+
BUILD_COMMIT: 'v1.18.3'
1313
PLAT: "x86_64"
1414
CYTHON_BUILD_DEP: "cython==0.29.16"
1515
NIGHTLY_BUILD_COMMIT: "master"
16-
NIGHTLY_BUILD: "false"
1716
TEST_DEPENDS: "pytest hypothesis cffi pytz"
1817
JUNITXML: "test-data.xml"
1918
TEST_DIR: "tmp_for_test"
@@ -33,16 +32,11 @@ jobs:
3332
- bash: |
3433
set -e
3534
36-
SKIP_BUILD="false"
3735
if [ "$BUILD_REASON" == "Schedule" ]; then
3836
BUILD_COMMIT=$NIGHTLY_BUILD_COMMIT
39-
if [ "$NIGHTLY_BUILD" != "true" ]; then
40-
SKIP_BUILD="true"
41-
fi
4237
fi
4338
echo "Building numpy@$BUILD_COMMIT"
4439
echo "##vso[task.setvariable variable=BUILD_COMMIT]$BUILD_COMMIT"
45-
echo "##vso[task.setvariable variable=SKIP_BUILD]$SKIP_BUILD"
4640
4741
# Platform variables used in multibuild scripts
4842
if [ `uname` == 'Darwin' ]; then
@@ -60,6 +54,7 @@ jobs:
6054
6155
- bash: |
6256
set -e
57+
echo $BUILD_COMMIT
6358
pip install virtualenv wheel
6459
BUILD_DEPENDS="$CYTHON_BUILD_DEP"
6560
@@ -74,55 +69,50 @@ jobs:
7469
./patch_code.sh $REPO_DIR
7570
build_wheel $REPO_DIR $PLAT
7671
displayName: Build wheel
77-
condition: eq(variables['SKIP_BUILD'], 'false')
7872
7973
- bash: |
80-
set -xe
74+
set -e
8175
source multibuild/common_utils.sh
8276
source multibuild/travis_steps.sh
8377
source extra_functions.sh
8478
setup_test_venv
8579
install_run $PLAT
8680
teardown_test_venv
8781
displayName: Install wheel and test
88-
condition: eq(variables['SKIP_BUILD'], 'false')
8982
9083
- bash: |
9184
echo "##vso[task.prependpath]$CONDA/bin"
9285
sudo chown -R $USER $CONDA
9386
displayName: Add conda to PATH
94-
condition: and(succeeded(), eq(variables['SKIP_BUILD'], 'false'), ne(variables['Build.Reason'], 'PullRequest'))
9587
9688
- bash: conda install -q -y anaconda-client
9789
displayName: Install anaconda-client
98-
condition: and(succeeded(), eq(variables['SKIP_BUILD'], 'false'), ne(variables['Build.Reason'], 'PullRequest'))
9990

10091
- bash: |
10192
set -e
10293
if [ "$BUILD_REASON" == "Schedule" ]; then
10394
ANACONDA_ORG="scipy-wheels-nightly"
104-
TOKEN="$NUMPY_NIGHTLY_UPLOAD_TOKEN"
95+
TOKEN="$MAPPED_NUMPY_NIGHTLY_UPLOAD_TOKEN"
10596
else
10697
ANACONDA_ORG="multibuild-wheels-staging"
107-
TOKEN="$NUMPY_STAGING_UPLOAD_TOKEN"
98+
TOKEN="$MAPPED_NUMPY_STAGING_UPLOAD_TOKEN"
10899
fi
109100
if [ "$TOKEN" == "" ]; then
110101
echo "##[warning] Could not find anaconda.org upload token in secret variables"
111102
fi
112103
echo "##vso[task.setvariable variable=TOKEN]$TOKEN"
113104
echo "##vso[task.setvariable variable=ANACONDA_ORG]$ANACONDA_ORG"
114105
displayName: Retrieve secret upload token
115-
condition: and(succeeded(), eq(variables['SKIP_BUILD'], 'false'), ne(variables['Build.Reason'], 'PullRequest'))
116106
env:
117107
# Secret variables need to mapped to env variables explicitly:
118-
NUMPY_NIGHTLY_UPLOAD_TOKEN: $(NUMPY_NIGHTLY_UPLOAD_TOKEN)
119-
NUMPY_STAGING_UPLOAD_TOKEN: $(NUMPY_STAGING_UPLOAD_TOKEN)
108+
MAPPED_NUMPY_NIGHTLY_UPLOAD_TOKEN: $(NUMPY_NIGHTLY_UPLOAD_TOKEN)
109+
MAPPED_NUMPY_STAGING_UPLOAD_TOKEN: $(NUMPY_STAGING_UPLOAD_TOKEN)
120110
121111
- bash: |
122112
set -e
123113
# The --force option forces a replacement if the remote file already
124114
# exists.
125-
ls wheelhouse/*.whl
115+
echo uploading wheelhouse/*.whl
126116
anaconda -t $TOKEN upload --force -u $ANACONDA_ORG wheelhouse/*.whl
127117
echo "PyPI-style index: https://pypi.anaconda.org/$ANACONDA_ORG/simple"
128118
displayName: Upload to anaconda.org (only if secret token is retrieved)

azure/windows.yml

+40-28
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,8 @@ jobs:
88
pool:
99
vmImage: ${{ parameters.vmImage }}
1010
variables:
11-
BUILD_COMMIT: "v1.18.2"
11+
BUILD_COMMIT: "v1.18.3"
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

@@ -37,16 +36,11 @@ jobs:
3736
displayName: Check that we have the expected version and architecture for Python
3837
- bash: |
3938
set -e
40-
SKIP_BUILD="false"
4139
if [ "$BUILD_REASON" == "Schedule" ]; then
4240
BUILD_COMMIT=$NIGHTLY_BUILD_COMMIT
43-
if [ "$NIGHTLY_BUILD" != "true" ]; then
44-
SKIP_BUILD="true"
45-
fi
4641
fi
4742
echo "Building numpy@$BUILD_COMMIT"
4843
echo "##vso[task.setvariable variable=BUILD_COMMIT]$BUILD_COMMIT"
49-
echo "##vso[task.setvariable variable=SKIP_BUILD]$SKIP_BUILD"
5044
# Store original Python path to be able to create test_venv pointing
5145
# to same Python version.
5246
PYTHON_EXE=`which python`
@@ -55,13 +49,18 @@ jobs:
5549
- bash: |
5650
set -e
5751
cd numpy
52+
git fetch origin HEAD
5853
git checkout $BUILD_COMMIT
5954
git clean -fxd
6055
git reset --hard
6156
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)
6362
- bash: |
64-
set -e
63+
set -xe
6564
pushd numpy
6665
pip install twine wheel urllib3
6766
# a bit overkill, all we really need is cython
@@ -70,65 +69,78 @@ jobs:
7069
# handle license
7170
cp ../LICENSE_win32.txt LICENSE.txt
7271
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
7884
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+
}
7992
# Build the wheel
93+
pushd numpy
8094
python setup.py build
8195
python setup.py bdist_wheel
82-
ls dist
8396
twine check dist/*
8497
popd
8598
displayName: Build wheel
86-
condition: eq(variables['SKIP_BUILD'], 'false')
8799
- bash: |
88100
set -ex
89101
source extra_functions.sh
90102
source config.sh
91103
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
94108
run_tests
109+
popd
95110
teardown_test_venv
96111
displayName: Install wheel and test
97-
condition: eq(variables['SKIP_BUILD'], 'false')
98112
99113
- bash: echo "##vso[task.prependpath]$CONDA/Scripts"
100114
displayName: Add conda to PATH
101-
condition: and(succeeded(), eq(variables['SKIP_BUILD'], 'false'), ne(variables['Build.Reason'], 'PullRequest'))
102115

103116
- bash: conda install -q -y anaconda-client
104117
displayName: Install anaconda-client
105-
condition: and(succeeded(), eq(variables['SKIP_BUILD'], 'false'), ne(variables['Build.Reason'], 'PullRequest'))
106118

107119
- bash: |
108120
set -e
109121
if [ "$BUILD_REASON" == "Schedule" ]; then
110122
ANACONDA_ORG="scipy-wheels-nightly"
111-
TOKEN="$NUMPY_NIGHTLY_UPLOAD_TOKEN"
123+
TOKEN="$MAPPED_NUMPY_NIGHTLY_UPLOAD_TOKEN"
112124
else
113125
ANACONDA_ORG="multibuild-wheels-staging"
114-
TOKEN="$NUMPY_STAGING_UPLOAD_TOKEN"
126+
TOKEN="$MAPPED_NUMPY_STAGING_UPLOAD_TOKEN"
115127
fi
116128
if [ "$TOKEN" == "" ]; then
117129
echo "##[warning] Could not find anaconda.org upload token in secret variables"
118130
fi
119131
echo "##vso[task.setvariable variable=TOKEN]$TOKEN"
120132
echo "##vso[task.setvariable variable=ANACONDA_ORG]$ANACONDA_ORG"
121133
displayName: Retrieve secret upload token
122-
condition: and(succeeded(), eq(variables['SKIP_BUILD'], 'false'), ne(variables['Build.Reason'], 'PullRequest'))
123134
env:
124135
# 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+
127139
- bash: |
128140
set -e
129141
# The --force option forces a replacement if the remote file already
130142
# exists.
131-
ls numpy/dist/numpy-*.whl
143+
echo uploading numpy/dist/numpy-*.whl
132144
anaconda -t $TOKEN upload --force -u $ANACONDA_ORG numpy/dist/numpy-*.whl
133145
echo "PyPI-style index: https://pypi.anaconda.org/$ANACONDA_ORG/simple"
134146
displayName: Upload to anaconda.org (only if secret token is retrieved)

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
}

extra_functions.sh

+4-1
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@ function setup_test_venv {
77
if [ $(uname) == "Darwin" ]; then
88
source test_venv/bin/activate
99
else
10+
mkdir -p test_venv/libs
1011
source test_venv/Scripts/activate
1112
fi
1213
# Note: the idiom "python -m pip install ..." is necessary to upgrade
1314
# pip itself on Windows. Otherwise one would get a permission error on
1415
# pip.exe.
16+
PYTHON_EXE=python
17+
PIP_CMD="$PYTHON_EXE -m pip"
1518
python -m pip install --upgrade pip wheel
1619
if [ "$TEST_DEPENDS" != "" ]; then
1720
pip install $TEST_DEPENDS
@@ -28,4 +31,4 @@ function teardown_test_venv {
2831
fi
2932
}
3033
# Work around bug in multibuild
31-
if [ ! -o PIP_CMD ]; then PIP_CMD="$PYTHON_EXE -mpip"; fi
34+
if [ ! -o PIP_CMD ]; then PIP_CMD="$PYTHON_EXE -m pip"; fi

0 commit comments

Comments
 (0)