-
Notifications
You must be signed in to change notification settings - Fork 166
/
azure-pipelines-release.yml
274 lines (221 loc) · 8.48 KB
/
azure-pipelines-release.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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
variables:
AZURE_BUILD: true
MACOSX_DEPLOYMENT_TARGET: "10.12" # This should match the -mmacosx-version-min flag in setup.py
trigger:
tags:
include:
- v*
pr: none
jobs:
- job: 'PackageWinOsx'
timeoutInMinutes: 0
cancelTimeoutInMinutes: 10
displayName: 'Build wheels ::'
pool:
vmImage: $(image.name)
strategy:
matrix:
osx - python39:
image.name: 'macos-latest'
python.version: '3.9'
ciwb.build: cp39-macosx_universal2
ciwb.archs: universal2
osx - python310:
image.name: 'macos-latest'
python.version: '3.10'
ciwb.build: cp310-macosx_universal2
ciwb.archs: universal2
osx - python311:
image.name: 'macos-latest'
python.version: '3.11'
ciwb.build: cp311-macosx_universal2
ciwb.archs: universal2
osx - python312:
image.name: 'macos-latest'
python.version: '3.12'
ciwb.build: cp312-macosx_universal2
ciwb.archs: universal2
windows - python39:
image.name: 'windows-latest'
python.version: '3.9'
ciwb.build: cp39-win_amd64
ciwb.archs: AMD64
windows - python310:
image.name: 'windows-latest'
python.version: '3.10'
ciwb.build: cp310-win_amd64
ciwb.archs: AMD64
windows - python311:
image.name: 'windows-latest'
python.version: '3.11'
ciwb.build: cp311-win_amd64
ciwb.archs: AMD64
windows - python312:
image.name: 'windows-latest'
python.version: '3.12'
ciwb.build: cp312-win_amd64
ciwb.archs: AMD64
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
architecture: 'x64'
displayName: 'Use Python $(python.version)'
- script: env
displayName: 'List enviromental variables'
- script: python -m pip install cibuildwheel
displayName: Installing build tools
- script: python -m cibuildwheel --output-dir dist/
displayName: 'Build wheel'
env:
CIBW_BUILD: $(ciwb.build)
CIBW_ARCHS: $(ciwb.archs)
CIBW_BUILD_VERBOSITY: 1
# Since Python automatically adds `cwd` to `sys.path`, it's important we remove the local folder
# containing our code from the working directory. Otherwise, the tests will use the local copy
# instead of the installed package. We can easily achieve this by renaming the source folder.
- bash: mv openTSNE src
displayName: 'Remove source files from path'
- bash: ls -lRh dist
displayName: 'List built files'
- bash: python -m pip install -v --force-reinstall --find-links=dist/ openTSNE
displayName: 'Install wheel'
- script: pip install pynndescent
displayName: 'Install optional dependencies - pynndescent'
- script: pip install hnswlib
env:
HNSWLIB_NO_NATIVE: 1 # -march=native is not available on clang, so just disable it
displayName: 'Install optional dependencies - hnswlib'
- bash: pip install pytest
displayName: 'Install pytest'
- bash: pip freeze -v
displayName: 'List packages'
- script: pytest -v
timeoutInMinutes: 15
displayName: 'Run unit tests'
- task: CopyFiles@2
condition: eq(variables['Agent.JobStatus'], 'Succeeded')
inputs:
contents: dist/**
targetFolder: $(Build.ArtifactStagingDirectory)
- task: PublishBuildArtifacts@1
condition: eq(variables['Agent.JobStatus'], 'Succeeded')
inputs:
artifactName: 'build'
pathtoPublish: $(Build.ArtifactStagingDirectory)
- job: 'PackageLinux'
timeoutInMinutes: 0
cancelTimeoutInMinutes: 10
displayName: 'Build wheels :: linux -'
pool:
vmImage: 'ubuntu-latest'
strategy:
matrix:
python39:
python: '/opt/python/cp39-cp39/bin'
python.version: '3.9'
python310:
python: '/opt/python/cp310-cp310/bin'
python.version: '3.10'
python311:
python: '/opt/python/cp311-cp311/bin'
python.version: '3.11'
python312:
python: '/opt/python/cp312-cp312/bin'
python.version: '3.12'
container:
image: quay.io/pypa/manylinux2014_x86_64:latest
options: -e PLAT=manylinux2014_x86_64
steps:
- bash: ls -R /opt/python
displayName: 'List available Python binaries'
- script: $(python)/pip install --user build
displayName: 'Installing build tools'
- script: $(python)/python -m build -w -o wheelhouse/ .
displayName: 'Build wheels'
# Bundle external shared libraries into the wheels
- script: |
for whl in wheelhouse/openTSNE*.whl; do
auditwheel show "$whl"
auditwheel repair "$whl" --plat $PLAT -w wheelhouse/
done
displayName: 'Repair wheels'
# Since Python automatically adds `cwd` to `sys.path`, it's important we remove the local folder
# containing our code from the working directory. Otherwise, the tests will use the local copy
# instead of the installed package. We can easily achieve this by renaming the source folder.
- bash: mv openTSNE src
displayName: 'Remove source files from path'
- bash: ls -lRh wheelhouse
displayName: 'List built files'
- script: $(python)/pip install -v --force-reinstall --find-links=wheelhouse/ openTSNE
displayName: 'Install openTSNE wheel'
- script: $(python)/pip install pynndescent
displayName: 'Install optional dependencies - pynndescent'
- script: $(python)/pip install hnswlib
displayName: 'Install optional dependencies - hnswlib'
- bash: $(python)/pip install --user pytest
displayName: 'Install pytest'
- bash: $(python)/pip freeze -v
displayName: 'List packages'
- script: $(python)/python -m pytest -v
timeoutInMinutes: 15
displayName: 'Run unit tests'
- bash: |
mkdir -p dist
cp wheelhouse/openTSNE*manylinux*.whl dist/
displayName: 'Copy files to dist folder'
- task: CopyFiles@2
condition: eq(variables['Agent.JobStatus'], 'Succeeded')
inputs:
contents: dist/**
targetFolder: $(Build.ArtifactStagingDirectory)
- task: PublishBuildArtifacts@1
condition: eq(variables['Agent.JobStatus'], 'Succeeded')
inputs:
artifactName: 'build'
pathtoPublish: $(Build.ArtifactStagingDirectory)
- job: 'sdist'
timeoutInMinutes: 0
cancelTimeoutInMinutes: 10
displayName: 'Package source distribution'
pool:
vmImage: 'ubuntu-latest'
steps:
- task: UsePythonVersion@0
displayName: 'Use Python 3.10'
inputs:
versionSpec: '3.10'
- script: python -m pip install build
displayName: Installing build tools
- script: python -m build -v --outdir dist --sdist
displayName: 'Build sdist'
- bash: ls -lRh dist
displayName: 'List built files'
- bash: python -m pip -v install --no-binary openTSNE --find-links=dist/ openTSNE --no-cache
displayName: 'Install package'
- script: pip install pynndescent
displayName: 'Install optional dependencies - pynndescent'
- script: pip install hnswlib
displayName: 'Install optional dependencies - hnswlib'
# Since Python automatically adds `cwd` to `sys.path`, it's important we remove the local folder
# containing our code from the working directory. Otherwise, the tests will use the local copy
# instead of the installed package. We can easily achieve this by renaming the source folder.
- bash: mv openTSNE src
displayName: 'Remove source files from path'
- bash: pip install pytest
displayName: 'Install pytest'
- bash: pip freeze -v
displayName: 'List packages'
- script: pytest -v
timeoutInMinutes: 15
displayName: 'Run unit tests'
- task: CopyFiles@2
condition: eq(variables['Agent.JobStatus'], 'Succeeded')
inputs:
contents: dist/**
targetFolder: $(Build.ArtifactStagingDirectory)
- task: PublishBuildArtifacts@1
condition: eq(variables['Agent.JobStatus'], 'Succeeded')
inputs:
artifactName: 'build'
pathtoPublish: $(Build.ArtifactStagingDirectory)