forked from hyperspy/hyperspy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
87 lines (76 loc) · 2.83 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
language: generic
env:
# We set the default value in global and changed it in the matrix when necessary
global:
- ENV=conda
- MINIMAL_ENV=false
- DEPS="numpy ipython scipy matplotlib traits natsort requests tqdm sympy dill h5py python-dateutil ipyparallel dask scikit-image pint numexpr statsmodels sparse imageio pyyaml PTable"
- DEPS_OPTIONAL="scikit-learn mrcz numba cython"
- TEST_DEPS="pytest pytest-cov pytest-mpl wheel"
- MPLBACKEND="agg"
- TEST_ARG_OPT="--mpl"
- FAIL_ON_EXTERNAL_DEPRECATION=false
services:
- xvfb
matrix:
include:
# All tests run for the latest supported Python version in Linux
- env: export CONDA_PYTHON=3.7
- env: export CONDA_PYTHON=3.7; MINIMAL_ENV=true
- env: export ENV=pip
language: python
python: 3.7
- env: export ENV=pip; MINIMAL_ENV=true
language: python
python: 3.7
# Only standard test for older supported versions of Python in Linux
- env: export CONDA_PYTHON=3.6
# All tests, but the min requirements test run for the latest supported Python version in OSx
- env: export CONDA_PYTHON=3.7
os: osx
- env: export CONDA_PYTHON=3.6
os: osx
if: tag IS present
allow_failures:
# Only test for the latest supported version as chances are that it'll
# contain the most up-to-date external libraries.
- env: export PYTHON=3.7; MINIMAL_ENV=false; FAIL_ON_EXTERNAL_DEPRECATION=true
before_install:
- if [ $ENV == conda ]; then
source ./ci/travis_setup_conda_$TRAVIS_OS_NAME.sh;
fi
install:
- if [[ $MINIMAL_ENV == false ]] ; then
DEPS="${DEPS} ${DEPS_OPTIONAL}";
fi
- source ./ci/travis_install_with_$ENV.sh
- pip install .
script:
- which python
- python -c 'import matplotlib.pyplot as plt; print("Matplotlib backend:", plt.get_backend())';
- if [ $ENV == pip ]; then TEST_ARG_OPT=""; fi
- pytest --pyargs hyperspy --cov=hyperspy $TEST_ARG_OPT;
#after_failure: # run only on failure in case there is a need to check matplotlib image comparison
# This needs a service to upload the artifacts (and corresponding configuration)
# See:
# https://blog.travis-ci.com/2012-12-18-travis-artifacts/
# https://docs.travis-ci.com/user/uploading-artifacts/
# https://github.com/matplotlib/matplotlib/blob/master/.travis.yml
# - gem install travis-artifacts
# - zip -r image_comparison_failure.zip /tmp/ -i *.png
# - travis-artifacts upload image_comparison_failure.zip
after_success:
- coveralls
- python setup.py bdist_wheel;
before_deploy:
- export DISTRIB=$(ls ./dist/*);
deploy:
provider: releases
api_key:
#francisco-dlp:
secure: dTt5L3HsIrfTOvnU8QFqwMu+Ghpuzp+vr0y7skRbqdFBCmPfjbAe2l24haMidVC1x0ZikHGgv9krEd/aKEBLi6QM+E2KsxiXUJWlhTFMH5o8qsMTBSAS2ChfQ32Jlktg8oK0FMs+UO6EFbMz1cr7m1Fgc0Ikds1ZCzev6Uke2Zk=
file: "${DISTRIB}"
skip_cleanup: true
on:
tags: true
condition: $MINIMAL_ENV = false