forked from yt-project/yt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
125 lines (114 loc) · 3.69 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
language: python
dist: xenial
cache:
pip: true
directories:
- $HOME/.ccache # https://github.com/travis-ci/travis-ci/issues/5853
addons:
apt:
packages:
- libhdf5-serial-dev
- libproj-dev
- proj-data
- proj-bin
- libgeos-dev
- libopenmpi-dev
env:
global:
PIP=pip
before_install:
- |
if [[ $TRAVIS_OS_NAME != 'osx' ]]; then
$PIP install --upgrade virtualenv
python -m virtualenv venv
source venv/bin/activate
export PATH=/usr/lib/ccache:$PATH
else
sudo mkdir -p /usr/local/man
sudo chown -R "${USER}:admin" /usr/local/man
brew update
brew install python ccache hdf5 proj geos openmpi netcdf
brew uninstall gdal postgis numpy
export PATH=/usr/local/opt/ccache/libexec:$PATH
fi
mkdir -p $HOME/.config/yt
echo "[yt]" > $HOME/.config/yt/ytrc
echo "suppressStreamLogging = True" >> $HOME/.config/yt/ytrc
cat $HOME/.config/yt/ytrc
cp tests/matplotlibrc .
install:
- |
# setup environment
ccache -s
# Upgrade pip and setuptools and wheel to get clean install
$PIP install --upgrade pip
$PIP install --upgrade wheel
$PIP install --upgrade setuptools
echo "Travis build stage: $TRAVIS_BUILD_STAGE_NAME"
# install dependencies yt
if [[ ${TRAVIS_BUILD_STAGE_NAME} == "lint" ]]; then
export TRAVIS_BUILD_STAGE_NAME="Lint"
fi
if [[ ${TRAVIS_BUILD_STAGE_NAME} != "Lint" ]]; then
if [[ $MINIMAL == 1 ]]; then
# The first numpy to support py3.6 is 1.12, but numpy 1.13 matches
# unyt so we'll match it here.
$PIP install numpy==1.13.3 cython==0.24
$PIP install -r tests/test_minimal_requirements.txt
else
# Getting cartopy installed requires getting cython and numpy installed
# first; this is potentially going to be fixed with the inclusion of
# pyproject.toml in cartopy.
# These versions are pinned, so we will need to update/remove them when
# the hack is no longer necessary.
$PIP install numpy==1.18.1 cython==0.29.6
CFLAGS="$CFLAGS -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H" $PIP install -r tests/test_requirements.txt
fi
$PIP install -e .
else
$PIP install -r tests/lint_requirements.txt
fi
jobs:
include:
- stage: Lint
python: 3.6
script: flake8 yt/
- stage: tests
name: "Python: 3.6 Minimal Dependency Unit Tests"
python: 3.6
env: MINIMAL=1
script: coverage run $(which nosetests) -c nose_unit.cfg
- stage: tests
name: "Python: 3.6 Unit Tests"
python: 3.6
script: coverage run $(which nosetests) -c nose_unit.cfg
- stage: tests
name: "Python: 3.8 Unit Tests"
python: 3.8
script: coverage run $(which nosetests) -c nose_unit.cfg
- stage: tests
name: "Python: 3.6 Answer Tests"
python: 3.6
script: coverage run $(which nosetests) -c nose_answer.cfg
after_failure: python tests/report_failed_answers.py -f -m --xunit-file "answer_nosetests.xml"
- stage: tests
name: "MacOS: Unit Tests"
os: osx
osx_image: xcode10.1
language: generic # https://github.com/travis-ci/travis-ci/issues/2312
env: PIP=pip3
cache:
pip: false
directories:
- $HOME/Library/Caches/pip
# `cache` does not support `env`-like `global` so copy-paste from top
- $HOME/.ccache # https://github.com/travis-ci/travis-ci/issues/5853
script: nosetests -c nose_unit.cfg
after_success:
- |
if [[ ${TRAVIS_BUILD_STAGE_NAME} == "lint" ]]; then
export TRAVIS_BUILD_STAGE_NAME="Lint"
fi
if [[ ${TRAVIS_BUILD_STAGE_NAME} != "Lint" ]]; then
codecov
fi