-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
125 lines (116 loc) · 3.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
# based on https://github.com/matplotlib/matplotlib/blob/master/.travis.yml
language: python
cache:
pip: true
directories:
# https://github.com/travis-ci/travis-ci/issues/5853
- $HOME/.ccache
- $HOME/.cache/matplotlib
env:
global:
- ARTIFACTS_AWS_REGION=us-east-1
- ARTIFACTS_BUCKET=matplotlib-test-results
# Variables controlling the build.
- MPLLOCALFREETYPE=1
# Variables controlling the test run.
- DELETE_FONT_CACHE=
- NO_AT_BRIDGE=1 # Necessary for GTK3 interactive test.
# The number of processes is hardcoded.
- NPROC=2
- OPENBLAS_NUM_THREADS=1
- PYTHONFAULTHANDLER=1
- PYTEST_ADDOPTS="-raR --log-level=DEBUG"
- RUN_PYTEST=1
- PATH=${TRAVIS_BUILD_DIR}/python/bin:$PATH
- PLATFORM=${TRAVIS_OS_NAME}
# matrix
matrix:
include:
- name: "Python 3.6 on OSX"
python: 3.6
sudo: true
os: osx
# https://github.com/travis-ci/travis-ci/issues/2312
language: shell
only: master
cache:
# As for now travis caches only "$HOME/.cache/pip".
# https://docs.travis-ci.com/user/caching/#pip-cache
pip: false
directories:
- $HOME/Library/Caches/pip
# - name: "Python 3.6 on Windows"
# python: 3.6
# sudo: true
# os: windows
# # https://github.com/travis-ci/travis-ci/issues/2312
# language: shell
# only: master
# before_install:
# - choco install python3
# - export PATH="/c/Python37:/c/Python37/Scripts:$PATH"
# before install
before_install: |
# test with non-ascii in path.
if [[ $TRAVIS_OS_NAME != 'osx' ]]; then
export PATH=/usr/lib/ccache:$PATH
which python3
python3 --version
fi
# command to install dependencies and package
install:
- |
# Setup environment.
git describe --tags
- |
# Set up virtualenv.
python3 -m venv env
source env/bin/activate
- |
# Make virtualenv as default python.
PYTHONPATH=$PYTHONPATH:$('env')
- |
# Path of python used.
which python3
- |
# Python version.
python3 --version
- |
# Upgrade pip, setuptools, wheel to get as clean an install as possible.
python3 -m pip install --upgrade pip setuptools wheel
- |
# Install from PyPI.
# Install package dependencies.
python3 -m pip install --quiet --requirement requirements.txt
# Install pytest dependencies.
python3 -m pip install --quiet --requirement imhr/dist/pytest_requirements.txt
# Install other required packages.
python3 -m pip install --quiet certifi
before_script:
- |
# Get current path.
bash -c 'echo $PWD'
- |
# Get repository directory path.
bash -c 'echo $PATH'
- |
# delete cache.
if [[ $DELETE_FONT_CACHE == 1 ]]; then
rm -rf ~/.cache/matplotlib
rm -rf $HOME/Library/Caches/pip
fi
# command to run tests, e.g. python setup.py test
script:
# each script we want to run need to go in it's own section and the program you want
# to fail travis need to be the last thing called.
- |
# Install package.
python3 setup.py install --quiet
- |
# Run pytest.
pytest --pyargs imhr.tests --html=report.html --self-contained-html
before_cache: |
rm -rf $HOME/.cache/matplotlib/tex.cache
rm -rf $HOME/.cache/matplotlib/test_cache
# notes
# -m uses module as script https://stackoverflow.com/questions/7610001/what-is-the-purpose-of-the-m-switch