forked from qutip/qutip
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
104 lines (93 loc) · 4.11 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
# After changing this file, check it on:
# http://lint.travis-ci.org/
# These just set the default, we'll override them for the Mac entries in the job
# matrix. Travis likes us to specify the defaults.
os: linux
dist: xenial
language: python
# This is overriden by the Mac versions, which also directly set
# _PYTHON_VERSION. We cannot set _PYTHON_VERSION to TRAVIS_PYTHON_VERSION here
# because the latter is not defined until after this environment setup takes
# place.
env: _CONDA_SUFFIX="Linux-x86_64"
# Set up conda with the correct version of conda.
before_install:
- wget "https://repo.continuum.io/miniconda/Miniconda3-latest-${_CONDA_SUFFIX}.sh" -O miniconda.sh
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- hash -r
- conda config --set always_yes yes --set changeps1 no
- conda info -a
# We have to use the older [[ -z "$x" ]] syntax rather than the more robust
# [[ ! -v _PYTHON_VERSION ]]
# because the macOS machines on Travis only have bash 3.2 (released 2006)!
- if [[ -z "$_PYTHON_VERSION" ]]; then export _PYTHON_VERSION="$TRAVIS_PYTHON_VERSION"; fi
- conda create -q -n test-environment python="$_PYTHON_VERSION"
- source activate test-environment
- QUTIP_DOWNLOAD=$(pwd -P)
# First move away from the download location so we don't try to import the
# non-installed version of QuTiP, then move closer to the installation location
# so file-name reporting is nicer.
before_script:
- mkdir -p _fake_dir
- cd _fake_dir
- QUTIP_INSTALL=$(dirname $(python -c 'import qutip; print(qutip.__file__)'))
- cd "${QUTIP_INSTALL}"
script:
- python -c "import qutip; qutip.about()"
- pytest -We --verbosity=1 --rootdir="${QUTIP_INSTALL}/tests" -c "${QUTIP_INSTALL}/tests/pytest.ini" --pyargs qutip
_mac_generic_setup: &mac_generic_setup
os: osx
language: generic
install:
- conda install nomkl blas=*=openblas numpy scipy matplotlib cython
- pip install pytest pytest-rerunfailures
- python setup.py install
jobs:
include:
- name: "Linux, Python 3.8: regular"
python: 3.8
install:
- conda install numpy scipy matplotlib cython
- pip install pytest pytest-rerunfailures
- python setup.py install
- name: "Linux, Python 3.7: OpenMP, MKL, scipy<1.5 (coverage)"
python: 3.7
# For source file line analysis on Coveralls, we need to make sure all
# file paths are prefixed by a known prefix, and the files are relative to
# the git repo root. It is enough to use the home directory on Travis,
# since we know this won't change, whereas the location of the installed
# egg _will_, because it changes based on the version number (not to
# mention it isn't necessarily the same file structure as the git repo).
# This is why we use `setup.py develop` here, and why we don't change
# directories.
install:
- conda install mkl blas=*=mkl numpy 'scipy<1.5' matplotlib cython cvxopt
- pip install pytest pytest-rerunfailures pytest-cov coveralls
- conda install -c conda-forge cvxpy
- python setup.py develop --with-openmp
before_script:
- QUTIP_INSTALL="${QUTIP_DOWNLOAD}/qutip"
- export QUTIP_NUM_PROCESSES=2
script:
- python -c "import qutip; qutip.about()"
- pytest -We --verbosity=1 --cov=qutip --cov-config="${QUTIP_DOWNLOAD}/.coveragerc" --rootdir="${QUTIP_INSTALL}/tests" -c "${QUTIP_INSTALL}/tests/pytest.ini" --pyargs qutip
after_success:
- coveralls
- name: "Linux, Python 3.6: No Cython, OpenBLAS"
python: 3.6
install:
- conda install nomkl blas=*=openblas numpy scipy matplotlib
- pip install pytest pytest-rerunfailures
- conda install cython --freeze-installed
- conda list
- python setup.py install
- conda uninstall cython
- name: "macOS, Python 3.7: XCode 11"
osx_image: xcode11
env: _CONDA_SUFFIX="MacOSX-x86_64" _PYTHON_VERSION="3.7"
<<: *mac_generic_setup
- name: "macOS, Python 3.8: XCode 12"
osx_image: xcode12
env: _CONDA_SUFFIX="MacOSX-x86_64" _PYTHON_VERSION="3.8"
<<: *mac_generic_setup