forked from matthewturk/yt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
145 lines (132 loc) · 4.14 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
language: python
dist: bionic
cache:
pip: true
directories:
- $HOME/.ccache # https://github.com/travis-ci/travis-ci/issues/5853
addons:
apt:
packages:
- libhdf5-serial-dev
- libnetcdf-dev
- libproj-dev
- proj-data
- proj-bin
- libgeos-dev
- libopenmpi-dev
env:
global:
PIP=pip
HOMEBREW_NO_AUTO_UPDATE=1
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
HOMEBREW_NO_AUTO_UPDATE=1 brew install hdf5 proj geos open-mpi netcdf ccache
HOMEBREW_NO_AUTO_UPDATE=1 brew uninstall gdal postgis numpy # WHY?
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
# Ensure numpy and cython are installed so dependencies that need to be built
# don't error out
# 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.26.1
$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.14
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
name: "flake8"
python: 3.6
script: |
flake8 --version
flake8 yt/
- stage: Lint
name: "isort"
python: 3.6
script: |
isort --version
isort . --check --diff
- stage: Lint
name: "black"
python: 3.6
script: |
black --version
black --check 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
# This is not necessarily going to be forever -- once we merge yt-4.0
# with master we will likely change this around to reduce the number of
# versions we test on.
- stage: tests
name: "Python: 3.7 Answer Tests"
python: 3.7
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: shell
env: PIP=pip3
cache:
- directories:
- $HOME/Library/Caches/pip
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