forked from scipy/scipy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
177 lines (174 loc) · 7.32 KB
/
azure-pipelines.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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
trigger:
# start a new build for every push
batch: False
branches:
include:
- master
- maintenance/*
paths:
include:
- '*'
exclude:
- 'benchmarks/*'
- './*.txt'
- 'site.cfg.example'
# the version of OpenBLAS used is currently 0.3.7
# and should be updated to match scipy-wheels as appropriate
jobs:
- job: Linux_Python_36_32bit_full
condition: and(succeeded(), ne(variables['Build.SourceBranch'], 'refs/heads/master')) # skip for PR merges
pool:
vmImage: 'ubuntu-16.04'
steps:
- script: |
docker pull i386/ubuntu:bionic
docker run -v $(pwd):/scipy i386/ubuntu:bionic /bin/bash -c "cd scipy && \
apt-get -y update && \
apt-get -y install curl python3.6-dev python3.6 python3-distutils pkg-config libpng-dev libjpeg8-dev libfreetype6-dev && \
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
python3.6 get-pip.py && \
pip3 --version && \
pip3 install setuptools wheel numpy cython==0.29.14 pybind11 pytest pytest-timeout pytest-xdist pytest-env pytest-cov Pillow mpmath matplotlib --user && \
apt-get -y install gfortran-5 wget && \
cd .. && \
mkdir openblas && cd openblas && \
wget https://3f23b170c54c2533c070-1c8a9b3114517dc5fe17b7c3f8c63a43.ssl.cf2.rackcdn.com/openblas-v0.3.7-manylinux1_i686.tar.gz && \
tar zxvf openblas-v0.3.7-manylinux1_i686.tar.gz && \
cp -r ./usr/local/lib/* /usr/lib && \
cp ./usr/local/include/* /usr/include && \
cd ../scipy && \
F77=gfortran-5 F90=gfortran-5 python3.6 runtests.py --mode=full -- -n auto -s --junitxml=junit/test-results.xml --cov-config=.coveragerc --cov-report=xml --cov-report=html"
displayName: 'Run 32-bit Ubuntu Docker Build / Tests'
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: '**/test-*.xml'
failTaskOnFailedTests: true
testRunTitle: 'Publish test results for Python 3.6-32 bit full Linux'
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov'
- job: Windows
condition: and(succeeded(), ne(variables['Build.SourceBranch'], 'refs/heads/master')) # skip for PR merges
pool:
vmImage: 'VS2017-Win2016'
variables:
OPENBLAS_32: https://3f23b170c54c2533c070-1c8a9b3114517dc5fe17b7c3f8c63a43.ssl.cf2.rackcdn.com/openblas-v0.3.7-win32-gcc_7_1_0.zip
OPENBLAS_64: https://3f23b170c54c2533c070-1c8a9b3114517dc5fe17b7c3f8c63a43.ssl.cf2.rackcdn.com/openblas-v0.3.7-win_amd64-gcc_7_1_0.zip
strategy:
maxParallel: 4
matrix:
Python36-32bit-full:
PYTHON_VERSION: '3.6'
PYTHON_ARCH: 'x86'
TEST_MODE: full
OPENBLAS: $(OPENBLAS_32)
BITS: 32
Python36-64bit-full:
PYTHON_VERSION: '3.6'
PYTHON_ARCH: 'x64'
TEST_MODE: full
OPENBLAS: $(OPENBLAS_64)
BITS: 64
Python37-64bit-full:
PYTHON_VERSION: '3.7'
PYTHON_ARCH: 'x64'
TEST_MODE: full
OPENBLAS: $(OPENBLAS_64)
BITS: 64
Python38-64bit-full:
PYTHON_VERSION: '3.8'
PYTHON_ARCH: 'x64'
TEST_MODE: full
OPENBLAS: $(OPENBLAS_64)
BITS: 64
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: $(PYTHON_VERSION)
addToPath: true
architecture: $(PYTHON_ARCH)
- script: python -m pip install --upgrade pip setuptools wheel
displayName: 'Install tools'
- powershell: |
$wc = New-Object net.webclient;
$wc.Downloadfile("$(OPENBLAS)", "openblas.zip")
$tmpdir = New-TemporaryFile | %{ rm $_; mkdir $_ }
Expand-Archive "openblas.zip" $tmpdir
$pyversion = python -c "from __future__ import print_function; import sys; print(sys.version.split()[0])"
Write-Host "Python Version: $pyversion"
$target = "C:\\hostedtoolcache\\windows\\Python\\$pyversion\\$(PYTHON_ARCH)\\lib\\openblas.a"
Write-Host "target path: $target"
cp $tmpdir\$(BITS)\lib\libopenblas_v0.3.7-gcc_7_1_0.a $target
displayName: 'Download / Install OpenBLAS'
- powershell: |
# wheels appear to use mingw64 version 6.3.0, but 6.4.0
# is the closest match available from choco package manager
choco install -y mingw --forcex86 --force --version=6.4.0
displayName: 'Install 32-bit mingw for 32-bit builds'
condition: and(succeeded(), eq(variables['BITS'], 32))
- powershell: |
choco install -y mingw --force --version=6.4.0
displayName: 'Install 64-bit mingw for 64-bit builds'
condition: and(succeeded(), eq(variables['BITS'], 64))
- script: python -m pip install numpy cython==0.29.14 pybind11 pytest pytest-timeout pytest-xdist pytest-env pytest-cov Pillow mpmath
displayName: 'Install dependencies'
- powershell: |
If ($(PYTHON_VERSION) -ne '3.6') {
python -m pip install matplotlib==3.2.0rc1
}
else {
python -m pip install matplotlib
}
displayName: 'Install matplotlib'
# DLL resolution mechanics were changed in
# Python 3.8: https://bugs.python.org/issue36085
# While we normally leave adjustment of _distributor_init.py
# up to the specific distributors of SciPy builds, we
# are the primary providers of the SciPy wheels available
# on PyPI, so we now regularly test that the version of
# _distributor_init.py in our wheels repo is capable of
# loading the DLLs from a master branch wheel build
- powershell: |
git clone -n --depth 1 https://github.com/MacPython/scipy-wheels.git
cd scipy-wheels
git checkout HEAD _distributor_init.py
cd ..
rm scipy/_distributor_init.py
mv scipy-wheels/_distributor_init.py scipy/
displayName: 'Copy in _distributor_init.py'
condition: and(succeeded(), eq(variables['PYTHON_VERSION'], '3.8'))
- powershell: |
If ($(BITS) -eq 32) {
# 32-bit build requires careful adjustments
# until Microsoft has a switch we can use
# directly for i686 mingw
$env:NPY_DISTUTILS_APPEND_FLAGS = 1
$env:CFLAGS = "-m32"
$env:LDFLAGS = "-m32"
refreshenv
}
$env:PATH = "C:\\ProgramData\\chocolatey\\lib\\mingw\\tools\\install\\mingw$(BITS)\\bin;" + $env:PATH
mkdir dist
pip wheel --no-build-isolation -v -v -v --wheel-dir=dist .
ls dist -r | Foreach-Object {
pip install $_.FullName
}
displayName: 'Build SciPy'
- powershell: |
$env:PATH = "C:\\ProgramData\\chocolatey\\lib\\mingw\\tools\\install\\mingw$(BITS)\\bin;" + $env:PATH
python runtests.py -n --mode=$(TEST_MODE) -- -n auto -rsx --junitxml=junit/test-results.xml --cov=scipy --cov-report=xml --cov-report=html
displayName: 'Run SciPy Test Suite'
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: '**/test-*.xml'
failTaskOnFailedTests: true
testRunTitle: 'Publish test results for Python $(python.version)'
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov'