-
Notifications
You must be signed in to change notification settings - Fork 107
/
.travis.yml
207 lines (171 loc) · 8.73 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
branches:
only:
- main
- /^releases\/.*/
language: python
compiler:
- g++
matrix:
# cf. https://blog.travis-ci.com/2019-08-07-extensive-python-testing-on-travis-ci
include:
# Basic python on linux
- python: 2.7
dist: xenial
name: "Python: 2.7"
- python: 3.6
dist: xenial
name: "Python: 3.6"
- python: 3.7
dist: xenial
name: "Python: 3.7"
env:
- __U=-U # Only update packages on python 3.7+
- python: 3.8
dist: xenial
name: "Python: 3.8"
env:
- __U=-U
# Note: All the rest are technically allowed to fail. This is mostly so the
# Travis runs can finish faster, since they often only do 4 at a time.
# But we should periodically check them and try to make sure they all work.
# Add a linux build with clang
- python: 3.6
env:
- COMPILER=clang
- CC=clang
- CXX=clang++
- LD_LIBRARY_PATH=/usr/local/clang/lib:$LD_LIBRARY_PATH
name: Linux clang (Python 3.6)
# Add a few macos builds
# Here, the python version is set by the xcode version.
- os: osx
osx_image: xcode9.3 # Has python 2.7.14_2
language: shell # language: python is an error on macos
env:
- TRAVIS_PYTHON_VERSION=2.7
# Note: Use --user to supersede existing versions rather than sudo pip ...
# since existing versions of some packages (e.g. numpy) live in /System/
# directory where delete operations are forbidden.
- __USER=--user
- __USER2=--user
- PATH=/Users/travis/Library/Python/2.7/bin:$PATH
name: OSX (Python 2.7)
# XCode 9.4 has a problem with pip regarding the SSL link to pypi and other places.
# Errors look like:
# pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
# Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)': /simple/setuptools/
# Could not fetch URL https://pypi.org/simple/setuptools/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/setuptools/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)) - skipping
# I (MJ) tried for a while to get it to work and was unsuccessful.
# cf. commits 3d2819b through 23256a8
# If anyone wants to give it a try at some point, feel free, but I'm giving up. :(
#- os: osx
# osx_image: xcode9.4 # Has python 3.6.5
# language: shell
# env:
# - TRAVIS_PYTHON_VERSION=3.6
# name: OSX (Python 3.6)
- os: osx
osx_image: xcode11 # Has python 3.7.4
language: shell
env:
- TRAVIS_PYTHON_VERSION=3.7
# This one doesn't have problems with /System stuff, but one of the dependencies
# wants to write into /usr/local/man. So use --user to avoid that.
- __USER=--user
- PATH=/Users/travis/Library/Python/3.7/bin:$PATH
- __U=-U
name: OSX (Python 3.7)
# Check 3.9-dev, but less concerned if this fails.
- python: 3.9-dev
dist: xenial
name: "Python: 3.9-dev"
env:
- __U=-U
# For grins, add pypy.
# So far this is limited by astropy not working on pypy yet.
- python: pypy3
name: PyPy
env:
- __U=-U
allow_failures:
- name: Linux clang (Python 3.6)
- os: osx
- python: 3.9-dev
- python: pypy3
fast_finish: true
before_install:
- export PATH=$(echo $PATH | tr ':' "\n" | sed '/\/opt\/python/d' | tr "\n" ":" | sed "s|::|:|g")
# Install the non-python dependencies: fftw, libav, eigen
- if [[ $TRAVIS_OS_NAME == "linux" ]]; then sudo -H apt-get -qq update; sudo -H apt-get install -y python-dev libfftw3-dev; fi
# py3.9 system doesn't seem to have blas, lapack.
- if [[ $TRAVIS_OS_NAME == "linux" && $TRAVIS_PYTHON_VERSION == 3.9 ]]; then sudo -H apt-get install -y libblas-dev liblapack-dev; fi
# Don't install eigen on 3.7 so we test the ability of setup.py to install it for us.
- if [[ $TRAVIS_OS_NAME == "linux" && $TRAVIS_PYTHON_VERSION < 3.7 ]]; then sudo -H apt-get install -y libeigen3-dev; fi
# Shouldn't usually need this, but occasionally might.
#- if [[ $TRAVIS_OS_NAME == "osx" ]]; then brew update; fi
- if [[ $TRAVIS_OS_NAME == "osx" ]]; then brew install fftw wget || true; fi
- if [[ $TRAVIS_OS_NAME == "osx" && $TRAVIS_PYTHON_VERSION < 3.7 ]]; then brew install eigen || true; brew link --overwrite eigen || true; fi
- if [[ $TRAVIS_OS_NAME == "osx" ]]; then brew cask install gfortran || true; fi
- if [[ $TRAVIS_OS_NAME == "osx" ]]; then brew upgrade wget || true; fi
- if [[ $TRAVIS_OS_NAME == "osx" ]]; then brew link --overwrite fftw gcc wget || true; fi
# Only need this for the mpeg tests, which we don't do on 2.7
- if [[ $TRAVIS_OS_NAME == "linux" && $TRAVIS_PYTHON_VERSION > 3.5 ]]; then sudo -H apt-get install -y libav-tools; fi
- if [[ $TRAVIS_OS_NAME == "osx" && $TRAVIS_PYTHON_VERSION > 3.5 ]]; then brew install libav || true; brew link --overwrite libav || true; fi
# List current contents of directories that should be being cached.
- ls -l $HOME
- if test -d $HOME/des_data; then ls -l $HOME/des_data; fi
# Get the des data needed for the check_des test.
# Note: --wildcards is invalid on Mac, but allowing wildcards is the default.
- __WILDCARDS=$([[ $TRAVIS_OS_NAME = "linux" ]] && echo "--wildcards" || echo "")
- if ! test -d $HOME/des_data || ! test -f $HOME/des_data/DECam_00154912_01.fits.fz; then wget --no-check-certificate http://www.sas.upenn.edu/~mjarvis/des_data.tar.gz; tar xfz des_data.tar.gz -C $HOME $__WILDCARDS *_01*; fi
- ln -s $HOME/des_data examples/des/
# Try to fix old pip on osx 2.7: https://github.com/pypa/pip/issues/5253
- if [[ $TRAVIS_OS_NAME == "osx" && $TRAVIS_PYTHON_VERSION < 3.0 ]]; then sudo python -m pip install -U pip; fi
# On OSX, need to use pip3, not pip and python3, not python
- if [[ $TRAVIS_OS_NAME == "osx" && $TRAVIS_PYTHON_VERSION > 3.0 ]]; then export PIP=pip3; export PYTHON=python3; else export PIP=pip; export PYTHON=python; fi
- $PIP --version
- $PYTHON --version
cache:
ccache: true
pip: true
directories:
- $HOME/des_data
- $HOME/Library/Caches/Homebrew
- /usr/local/Cellar/
install:
# Upate pip executable. (Needs sudo on some systems.)
- sudo -H $PIP install $__U pip
# Install the requirements
# Use -U to make sure we get the latest versions of everything so we notice any
# incompatibilities as soon as possible. (Only on python 3.7 now.)
- $PIP install -U $__USER numpy # Do these three first to clarify potential conflicts.
- $PIP install -U $__USER setuptools
- $PIP install -U $__USER wheel
- $PIP install $__U $__USER -r requirements.txt
# Also some things just required for tests
- $PIP install $__U $__USER -r test_requirements.txt
# On Travix OSX, nose is already installed, but nosetests isn't in the path.
# So we need to force it to reinstall, which puts nosetests in /usr/local/bin/
- if [[ $TRAVIS_OS_NAME == "osx" ]]; then sudo -H $PIP install --force $__USER -v nose; fi
# Finally, a few things for the code coverage
- $PIP install $__U $__USER nose codecov coverage
# A few things we only bother with on py >= 3.6
- if [[ $TRAVIS_PYTHON_VERSION > 3.5 ]]; then $PIP install $__U $__USER pandas starlink-pyast matplotlib astroplan; fi
- $PIP list
script:
# Install GalSim
- $PYTHON setup.py install $__USER2
# If galsim_download_cosmos.py changed, then run it. (Just on 3.6.)
- echo $TRAVIS_COMMIT_RANGE
- if [[ $TRAVIS_PYTHON_VERSION == 3.6 ]]; then if git --no-pager diff $TRAVIS_COMMIT_RANGE --name-only | grep -Fxq 'galsim/download_cosmos.py'; then galsim_download_cosmos -s 23.5 -v1; fi; fi
- cd tests
# Use this rather than setup.py test, so we can get the coverage options.
- nosetests test*.py --with-coverage --cover-package=galsim --with-doctest --cover-erase
- nosetests run_examples.py
after_success:
# Send results to codecov
- codecov
before_cache:
- rm -rfv $HOME/.cache/pip/log
- rm -rfv $HOME/.cache/pip/http
- if [[ $TRAVIS_OS_NAME == "osx" ]]; then brew cleanup; fi