This repository has been archived by the owner on Feb 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
/
azure-posix.yml
139 lines (118 loc) · 4.98 KB
/
azure-posix.yml
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
parameters:
name: ""
vmImage: ""
matrix: []
jobs:
- job: ${{ parameters.name }}
timeoutInMinutes: 150
pool:
vmImage: ${{ parameters.vmImage }}
variables:
REPO_DIR: "scipy"
PLAT: "x86_64"
NIGHTLY_BUILD_COMMIT: "main"
DAILY_COMMIT: "main"
strategy:
matrix:
${{ insert }}: ${{ parameters.matrix }}
steps:
- checkout: self
submodules: true
- task: UsePythonVersion@0
inputs:
versionSpec: $(AZURE_PYTHON_VERSION)
displayName: Set python version from AZURE
condition: ne( coalesce (variables['AZURE_PYTHON_VERSION'], 'NONE'), 'NONE')
- task: UsePythonVersion@0
inputs:
versionSpec: $(MB_PYTHON_VERSION)
displayName: Set python version from MB
condition: eq( coalesce (variables['AZURE_PYTHON_VERSION'], 'NONE'), 'NONE')
- bash: |
set -e
if [ "$BUILD_REASON" == "Schedule" ]; then
BUILD_COMMIT=$NIGHTLY_BUILD_COMMIT
fi
echo "Building scipy@$BUILD_COMMIT"
echo "##vso[task.setvariable variable=BUILD_COMMIT]$BUILD_COMMIT"
# Platform variables used in multibuild scripts
if [ `uname` == 'Darwin' ]; then
echo "##vso[task.setvariable variable=TRAVIS_OS_NAME]osx"
echo "##vso[task.setvariable variable=MACOSX_DEPLOYMENT_TARGET]10.9"
else
echo "##vso[task.setvariable variable=TRAVIS_OS_NAME]linux"
fi
# Store original Python path to be able to create test_venv pointing
# to same Python version.
PYTHON_EXE=`which python`
echo "##vso[task.setvariable variable=PYTHON_EXE]$PYTHON_EXE"
displayName: Define build env variables
- bash: |
set -ex
echo building for commit "$BUILD_COMMIT"
pip install --upgrade virtualenv wheel
BUILD_DEPENDS="wheel oldest-supported-numpy Cython>=0.29.24 pybind11>=2.4.3 pythran setuptools<60.0.0"
source multibuild/common_utils.sh
source multibuild/travis_steps.sh
before_install
clean_code $REPO_DIR $BUILD_COMMIT
./patch_code.sh $REPO_DIR
build_wheel $REPO_DIR $PLAT
displayName: Build wheel
- bash: |
set -xe
TEST_DEPENDS="oldest-supported-numpy pytest pytest-xdist pytest-faulthandler pytest-env"
source multibuild/common_utils.sh
source multibuild/travis_steps.sh
install_run $PLAT
displayName: Install wheel and test
condition: ne(variables['PLAT'], 'arm64')
- bash: |
set -xe
for file in `find ./wheelhouse -type f -name '*11_0_arm64*.whl'`; do mv -v "$file" "${file/11_0_arm64/12_0_arm64}"; done
displayName: "Rename MacOS arm64 wheels for version 12.0 minimum"
condition: or(eq(variables['PLAT'], 'arm64'), eq(variables['PLAT'], 'universal2'))
- bash: |
set -xe
for file in `find ./wheelhouse -type f -name '*10_9_universal2.whl'`; do mv -v "$file" "${file/macosx_10_9_universal2/macosx_12_0_universal2.macosx_10_9_x86_64}"; done
displayName: "Rename MacOS universal2 wheels for version 12.0 minimum"
condition: eq(variables['PLAT'], 'universal2')
- bash: |
set -xe
python verify_init.py ./wheelhouse
displayName: "Check for appropriate contents of _distributor_init.py"
- bash: |
echo "##vso[task.prependpath]$CONDA/bin"
sudo chown -R $USER $CONDA
displayName: Add conda to PATH
- bash: conda install -q -y anaconda-client
displayName: Install anaconda-client
- bash: |
set -e
if [ "$BUILD_COMMIT" == "main" ]; then
ANACONDA_ORG="scipy-wheels-nightly"
TOKEN="$MAPPED_SCIPY_WHEELS_NIGHTLY"
echo getting SCIPY_WHEELS_NIGHTLY
else
ANACONDA_ORG="multibuild-wheels-staging"
TOKEN="$MAPPED_SCIPY_STAGING_UPLOAD_TOKEN"
echo getting SCIPY_STAGING_UPLOAD_TOKEN
fi
if [ "$TOKEN" == "" -o "${TOKEN:0:7}" == "\$(SCIPY" ]; then
echo "##[warning] Could not find anaconda.org upload token in secret variables"
TOKEN=""
fi
echo "##vso[task.setvariable variable=TOKEN]$TOKEN"
echo "##vso[task.setvariable variable=ANACONDA_ORG]$ANACONDA_ORG"
displayName: Retrieve secret upload token
env:
# Secret variables need to mapped to env variables explicitly:
MAPPED_SCIPY_WHEELS_NIGHTLY: $(SCIPY_WHEELS_NIGHTLY)
MAPPED_SCIPY_STAGING_UPLOAD_TOKEN: $(SCIPY_STAGING_UPLOAD_TOKEN)
- bash: |
set -e
echo uploading wheelhouse/*.whl
anaconda -v -t $TOKEN upload --force -u $ANACONDA_ORG wheelhouse/*.whl
echo "PyPI-style index: https://pypi.anaconda.org/$ANACONDA_ORG/simple"
displayName: Upload to anaconda.org (only if secret token is retrieved)
condition: ne(variables['TOKEN'], '')