This repository has been archived by the owner on Mar 8, 2020. It is now read-only.
/
.travis.yml
161 lines (147 loc) · 4.37 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
# After changing this file, check it on: https://lint.travis-ci.org/
# Conda install recipe based on:
# https://gist.github.com/dan-blanchard/7045057
# https://conda.pydata.org/docs/travis.html
language: python
# We need to explicitely set all combination of the test matrix because Travis
# macOS images do not support Python. See:
# https://docs.travis-ci.com/user/multi-os/#Python-example-(unsupported-languages)
matrix:
include:
# We're not directly using the Python distribution provided by Travis, but
# this variable will be fed to Conda to install the right version.
- python: "2.7"
env: PYTHON_DIST="2.7"
- python: "3.4"
env: PYTHON_DIST="3.4"
- python: "3.5"
env: PYTHON_DIST="3.5"
- python: "3.6"
env: PYTHON_DIST="3.6"
# Xcode to macOS version matrix is available at:
# https://docs.travis-ci.com/user/reference/osx/#os-x-version
# Mac OS X 10.10 latest image is Xcode 6.4.
- language: generic
os: osx
osx_image: xcode6.4
env: PYTHON_DIST="2.7"
- language: generic
os: osx
osx_image: xcode6.4
env: PYTHON_DIST="3.4"
- language: generic
os: osx
osx_image: xcode6.4
env: PYTHON_DIST="3.5"
- language: generic
os: osx
osx_image: xcode6.4
env: PYTHON_DIST="3.6"
# Mac OS X 10.11 latest image is Xcode 8.
- language: generic
os: osx
osx_image: xcode8
env: PYTHON_DIST="2.7"
- language: generic
os: osx
osx_image: xcode8
env: PYTHON_DIST="3.4"
- language: generic
os: osx
osx_image: xcode8
env: PYTHON_DIST="3.5"
- language: generic
os: osx
osx_image: xcode8
env: PYTHON_DIST="3.6"
# macOS 10.12 latest image is Xcode 9.2.
- language: generic
os: osx
osx_image: xcode9.2
env: PYTHON_DIST="2.7"
- language: generic
os: osx
osx_image: xcode9.2
env: PYTHON_DIST="3.4"
- language: generic
os: osx
osx_image: xcode9.2
env: PYTHON_DIST="3.5"
- language: generic
os: osx
osx_image: xcode9.2
env: PYTHON_DIST="3.6"
# macOS 10.13 latest image is Xcode 9.3.
- language: generic
os: osx
osx_image: xcode9.3
env: PYTHON_DIST="2.7"
- language: generic
os: osx
osx_image: xcode9.3
env: PYTHON_DIST="3.4"
- language: generic
os: osx
osx_image: xcode9.3
env: PYTHON_DIST="3.5"
- language: generic
os: osx
osx_image: xcode9.3
env: PYTHON_DIST="3.6"
# Update the system and setup a fresh Anaconda ecosystem.
before_install:
# Show environment variables for debugging.
- env
# Check default Python version installed.
- python --version
# Explicitly download the Miniconda dedicated to the Python version we
# target, to ensure stability in case the default change in the future. Also
# speed things up a little bit by only installing the minimal requirements.
- if [[ "$PYTHON_DIST" == "2.7" ]]; then
MINICONDA_DIST="Miniconda2-latest";
else
MINICONDA_DIST="Miniconda3-latest";
fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
MINICONDA_DIST="$MINICONDA_DIST-MacOSX-x86_64.sh";
else
MINICONDA_DIST="$MINICONDA_DIST-Linux-x86_64.sh";
fi
- wget https://repo.continuum.io/miniconda/$MINICONDA_DIST -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 update --all
# Useful for debugging any issues with Conda.
- conda info --all
install:
# Create an Anaconda virtual env in a particular Python version.
- conda create --name test_env python=$PYTHON_DIST
- conda env update --name test_env --file ./conda.yml
- source activate test_env
# Check we installed the right Python version.
- python --version
- pip --version
- pip freeze
before_script:
- pip install codecov
script:
# Launch unittests.
- pip install -e .[tests]
- pytest
# Check coding style.
- pycodestyle
# Test that there is no conflicting dependencies.
- pipdeptree --warn fail
# Test that building packages works.
- pip install -e .[develop]
- ./setup.py sdist bdist_egg bdist_wheel
# Validates package metadata.
- ./setup.py check -m -r -s
after_script:
- codecov
notifications:
email:
on_success: never
on_failure: always