@@ -9,23 +9,51 @@ python:
9
9
- 3.7
10
10
- 3.8
11
11
env :
12
- - INSTALL_EXTRAS=[plotting,bloch_sphere_visualization,fancy_progressbar,doc,tests]
13
- - INSTALL_EXTRAS=[plotting,fancy_progressbar,tests]
14
- - INSTALL_EXTRAS=[tests]
15
-
16
- # these directories are persistent
17
- cache : pip
18
-
19
- # manually install these dependencies so that qutip can be installed via pip
12
+ global :
13
+ - INSTALL_DEPS="numpy scipy opt_einsum sparse tqdm"
14
+ - INSTALL_TEST_DEPS="pytest>=4.6 pytest-cov codecov"
15
+ - plotting="matplotlib"
16
+ - fancy_progressbar="jupyter requests"
17
+ - bloch_sphere_visualization="matplotlib qutip"
18
+ jobs :
19
+ - INSTALL_EXTRAS=[plotting,bloch_sphere_visualization,fancy_progressbar]
20
+ - INSTALL_EXTRAS=[plotting,fancy_progressbar]
21
+ - INSTALL_EXTRAS=[none]
22
+
20
23
before_install :
21
- - pip install --upgrade pip
22
- - pip install numpy scipy cython
24
+ # Resolve INSTALL_EXTRAS into required packages for use with conda. HACKY
25
+ - TMP=${INSTALL_EXTRAS//,/ $}
26
+ - TMP=${TMP/[/$}
27
+ - INSTALL_EXTRAS_PACKAGES=$(eval echo ${TMP%]})
28
+
29
+ # Useful info for debugging
30
+ - echo $TRAVIS_PYTHON_VERSION
31
+ - echo $INSTALL_DEPS
32
+ - echo $INSTALL_TEST_DEPS
33
+ - echo $INSTALL_EXTRAS
34
+ - echo $INSTALL_EXTRAS_PACKAGES
35
+
36
+ # https://github.com/conda/conda/blob/master/docs/source/user-guide/tasks/use-conda-with-travis-ci.rst
37
+ # We do this conditionally because it saves us some downloading if the
38
+ # version is the same.
39
+ - wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
40
+ - bash miniconda.sh -b -u -p $HOME/miniconda
41
+ - export PATH="$HOME/miniconda/bin:$PATH"
42
+ - hash -r
43
+ - conda config --set always_yes yes --set changeps1 no
44
+ - conda config --append channels conda-forge
45
+ - conda update -q conda
46
+ # Useful for debugging any issues with conda
47
+ - conda info -a
23
48
49
+ - conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION $INSTALL_DEPS $INSTALL_TEST_DEPS $INSTALL_EXTRAS_PACKAGES
50
+ - source activate test-environment
51
+
24
52
install :
25
- - pip install .$INSTALL_EXTRAS
53
+ - pip install .
26
54
27
55
script :
28
- - pytest tests
56
+ - pytest
29
57
30
58
after_success :
31
59
- codecov
0 commit comments