forked from Qiskit/qiskit-aer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
351 lines (332 loc) · 10.4 KB
/
.travis.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
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
# Copyright 2018, IBM.
#
# This source code is licensed under the Apache License, Version 2.0 found in
# the LICENSE.txt file in the root directory of this source tree.
notifications:
email: false
cache:
pip: true
directories:
- .stestr
sudo: false
###############################################################################
# Anchored and aliased definitions.
###############################################################################
# These are used for avoiding repeating code, and due to problems with
# overriding some keys (in particular, "os" and "language: ptyhon") when using
# the standard travis matrix with stages.
#
# This allows re-using different "sets" of configurations in the stages
# matrix, mimicking a hierarchy:
# * stage_generic
# * stage_linux
# * stage_osx
stage_generic: &stage_generic
install:
- pip install -U 'pip<20.0.0'
- pip install cython
# Install terra from master on aer master else use the most recent release
- |
if [[ $TRAVIS_BRANCH == "master" ]] ; then
pip install -c constraints.txt https://github.com/Qiskit/qiskit-terra/archive/master.zip
else
pip install -U -c constraints.txt qiskit-terra
fi
# Installing qiskit-aer...
- pip install -U -c constraints.txt -r requirements-dev.txt
env:
- QISKIT_SUPPRESS_PACKAGING_WARNINGS=Y
stage_linux: &stage_linux
<<: *stage_generic
os: linux
dist: bionic
language: python
python: 3.7
sudo: true
before_install:
- sudo apt-get -y update
- sudo apt-get -y install g++-7
before_script:
- |
if [ ! "$(ls -A .stestr)" ]; then
rm -rf .stestr
fi
# Build with Thrust OpenMP CPU backend
- python setup.py bdist_wheel -- -DCMAKE_CXX_COMPILER=g++-7 -DAER_THRUST_BACKEND=OMP -- -j4
- pip install dist/qiskit_aer*whl
script:
- pip check
- stestr run --slowest
stage_osx: &stage_osx
<<: *stage_generic
os: osx
osx_image: xcode9.4
language: generic
python: 3.7
env:
- QISKIT_SUPPRESS_PACKAGING_WARNINGS=Y
- MPLBACKEND=ps
- PYTHON_VERSION=3.7.2
cache:
pip: true
directories:
- ~/python-interpreters/
- .stestr
before_install:
# Travis does not provide support for Python 3 under osx - it needs to be
# installed manually.
- |
if [ ${TRAVIS_OS_NAME} = "osx" ]; then
if [[ ! -d ~/python-interpreters/$PYTHON_VERSION ]]; then
git clone git://github.com/pyenv/pyenv.git
cd pyenv/plugins/python-build
./install.sh
cd ../../..
python-build $PYTHON_VERSION ~/python-interpreters/$PYTHON_VERSION
fi
sudo pip2 install -U virtualenv pip setuptools
virtualenv --python ~/python-interpreters/$PYTHON_VERSION/bin/python venv
source venv/bin/activate
fi
before_script:
# Build with Thrust OpenMP CPU backend
- python setup.py bdist_wheel -- -DAER_THRUST_BACKEND=OMP -- -j4
- pip install dist/qiskit_aer*whl
script:
- python setup.py bdist_wheel -- -- -j4
- pip install dist/qiskit_aer*whl
script:
- pip check
- stestr run --slowest
###############################################################################
# Stage-related definitions
###############################################################################
# Define the order of the stages.
stages:
- name: deploy
if: tag IS present
- name: lint
if: tag IS blank
- name: compile
if: tag IS blank
- name: test
if: tag IS blank
# Define the job matrix explicitly, as matrix expansion causes issues when
# using it with stages and some variables/sections cannot be overridden.
jobs:
include:
# "lint" stage
###########################################################################
# C++ and Python linters
# TODO: C++ clang-tidy!
- stage: lint
name: Python Style and Linter
<<: *stage_linux
before_script: true
script:
- pycodestyle --ignore=E402,W504 --max-line-length=100 qiskit/providers/aer
- pylint -j 2 -rn qiskit/providers/aer
# "compile" stage
###########################################################################
# Linux Wheel
- stage: compile
name: Python Wheel Build Linux
language: python
python: 3.7
os: linux
services:
- docker
env:
- CIBW_BEFORE_BUILD="pip install -U Cython pip virtualenv pybind11"
- CIBW_SKIP="cp27-* cp34-* *-manylinux_i686"
- CIBW_MANYLINUX_X86_64_IMAGE="manylinux2010"
- CIBW_MANYLINUX_I686_IMAGE="manylinux2010"
- CIBW_TEST_COMMAND="python3 {project}/tools/verify_wheels.py"
- CIBW_TEST_REQUIRES="git+https://github.com/Qiskit/qiskit-terra.git"
script:
- pip install -U pip virtualenv twine
- pip install cibuildwheel==1.1.0
- cibuildwheel --output-dir wheelhouse
- stage: compile
name: Python sdist Build Linux
<<: *stage_linux
before_script:
- pip install -U virtualenv pip setuptools
script:
- python setup.py sdist
- mkdir out; cd out; virtualenv aer-test
- aer-test/bin/pip install -c ../constraints.txt git+https://github.com/Qiskit/qiskit-terra
- aer-test/bin/pip install ../dist/*tar.gz
- aer-test/bin/python ../tools/verify_wheels.py
- aer-test/bin/pip check
# MacOS Wheel
- stage: compile
name: Python Wheel Build MacOS
<<: *stage_osx
before_script: true
script:
- python setup.py bdist_wheel -- -DAER_THRUST_BACKEND=OMP -- -j4
- stage: compile
name: Python sdist Build MacOS
<<: *stage_osx
before_script:
- pip install -U virtualenv pip setuptools
script:
- python setup.py sdist
- mkdir out; cd out; virtualenv aer-test
- aer-test/bin/pip install -c ../constraints.txt git+https://github.com/Qiskit/qiskit-terra
- aer-test/bin/pip install ../dist/*tar.gz
- aer-test/bin/python ../tools/verify_wheels.py
- aer-test/bin/pip check
# Linux Standalone
- stage: compile
name: Standalone Build Linux
<<: *stage_linux
language: cpp
install:
- pip install conan
before_script: true
script:
- mkdir out; cd out; cmake ..
- make
# "test" stage
###########################################################################
# GNU/Linux, Python 3.8
- stage: test
name: Python 3.8 Tests Linux
<<: *stage_linux
python: 3.8
# GNU/Linux, Python 3.7
- stage: test
name: Python 3.7 Tests Linux
<<: *stage_linux
python: 3.7
# GNU/Linux, Python 3.6
- stage: test
if: type = cron
name: Python 3.6 Tests Linux
<<: *stage_linux
python: 3.6
# GNU/Linux, Python 3.5
- stage: test
if: type = cron
name: Python 3.5 Tests Linux
<<: *stage_linux
python: 3.5
# MacOS, Python 3.8 (via pyenv)
- stage: test
if: type = cron
name: Python 3.8 Tests MacOS
<<: *stage_osx
python: 3.8
env:
- QISKIT_SUPPRESS_PACKAGING_WARNINGS=Y
- PYTHON_VERSION=3.8.1
# MacOS, Python 3.7 (via pyenv)
- stage: test
name: Python 3.7 Tests MacOS
<<: *stage_osx
python: 3.7
env:
- MPLBACKEND=ps
- PYTHON_VERSION=3.7.2
- QISKIT_SUPPRESS_PACKAGING_WARNINGS=Y
# MacOS, Python 3.6 (via pyenv)
- stage: test
if: type = cron
name: Python 3.6 Tests MacOS
<<: *stage_osx
python: 3.6
env:
- MPLBACKEND=ps
- PYTHON_VERSION=3.6.5
- QISKIT_SUPPRESS_PACKAGING_WARNINGS=Y
# MacOS, Python 3.5 (via pyenv)
- stage: test
if: type = cron
name: Python 3.5 Tests MacOS
<<: *stage_osx
python: 3.5
env:
- MPLBACKEND=ps
- PYTHON_VERSION=3.5.6
- QISKIT_SUPPRESS_PACKAGING_WARNINGS=Y
# "deploy" stage
##########################################################################
#
- name: Release Linux Wheel Builds and Upload
stage: deploy
language: python
python: 3.7
os: linux
services:
- docker
env:
- CIBW_BEFORE_BUILD="pip install -U Cython pip virtualenv pybind11"
- CIBW_SKIP="cp27-* cp34-* *-manylinux_i686"
- CIBW_MANYLINUX_X86_64_IMAGE="manylinux2010"
- CIBW_MANYLINUX_I686_IMAGE="manylinux2010"
- TWINE_USERNAME=qiskit
- CIBW_TEST_COMMAND="python3 {project}/tools/verify_wheels.py"
- CIBW_TEST_REQUIRES="git+https://github.com/Qiskit/qiskit-terra.git"
if: tag IS present
script:
- pip install -U pip virtualenv twine
- pip install cibuildwheel==1.1.0
- cibuildwheel --output-dir wheelhouse
- twine upload wheelhouse/*
- name: sdist Build and Upload
stage: deploy
if: tag IS present
<<: *stage_linux
env:
- TWINE_USERNAME=qiskit
python: 3.7
before_script:
- pip install -U pip setuptools virtualenv twine
install: true
script:
- python setup.py sdist
- twine upload dist/*
- name: Release MacOS Wheel Builds and Upload
os: osx
stage: deploy
if: tag IS present
env:
- CIBW_BEFORE_BUILD="pip install -U Cython pip virtualenv pybind11"
- CIBW_SKIP="cp27-* cp34-*"
- TWINE_USERNAME=qiskit
- CIBW_TEST_COMMAND="python3 {project}/tools/verify_wheels.py"
- CIBW_TEST_REQUIRES="git+https://github.com/Qiskit/qiskit-terra.git"
script:
- sudo pip2 install -U pip virtualenv
- sudo pip2 install cibuildwheel==1.1.0 'twine<2.0'
- cibuildwheel --output-dir wheelhouse
- twine upload wheelhouse/*
# Power tests (currently failing)
allow_failures:
# Power Build test
- stage: compile
name: Python Wheel Build Linux (Power)
arch: ppc64le
<<: *stage_linux
before_script: true
script:
- python setup.py bdist_wheel -- -DCMAKE_CXX_COMPILER=g++-7 -DAER_THRUST_BACKEND=OMP -- -j4
# Linux Standalone
- stage: compile
name: Standalone Build Linux (Power)
arch: ppc64le
<<: *stage_linux
install:
- pip install conan
before_script: true
script:
- mkdir out; cd out; cmake ..
- make
# Power/Linux, Python 3.7
- stage: test
arch: ppc64le
name: Python 3.7 Tests Linux (Power)
<<: *stage_linux
python: 3.7