forked from networkx/networkx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
167 lines (147 loc) · 6.04 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
# After changing this file, check it on:
# http://lint.travis-ci.org/
#
language: python
python:
- "2.7"
- "3.2"
- "3.3"
- "3.4"
matrix:
fast_finish: true
include:
- python: "2.7"
env: PYTHON_VM=ipy OPTIONAL_DEPS=no
- python: "pypy"
env: PYTHON_VM=pypy OPTIONAL_DEPS=no
- python: "pypy3"
env: PYTHON_VM=pypy OPTIONAL_DEPS=no
allow_failures:
- env: PYTHON_VM=ipy OPTIONAL_DEPS=no
- python: "pypy"
env:
matrix:
- OPTIONAL_DEPS=miniconda
- OPTIONAL_DEPS=no
before_install:
### Prepare the system to install prerequisites or dependencies
- uname -a
- printenv
# Workaround for travis-ci/travis-ci#2683
- if [[ "${PYTHON_VM}" != ipy ]]; then
sudo rm /etc/apt/sources.list.d/pgdg-source.list*;
sudo add-apt-repository -y ppa:ubuntugis/ubuntugis-unstable;
sudo apt-get update -qq;
fi
- if [[ "${OPTIONAL_DEPS}" == miniconda ]]; then
if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
wget http://repo.continuum.io/miniconda/Miniconda-3.7.0-Linux-x86_64.sh -O miniconda.sh;
else
wget http://repo.continuum.io/miniconda/Miniconda3-3.7.0-Linux-x86_64.sh -O miniconda.sh;
fi;
bash miniconda.sh -b -p $HOME/miniconda;
export PATH="$HOME/miniconda/bin:$PATH";
hash -r;
conda info -a;
conda config --set always_yes yes --set changeps1 no;
conda update -q conda;
fi
- if [[ "${PYTHON_VM}" == ipy ]]; then
pushd ..;
curl -L -o xamarin.pgp http://download.mono-project.com/repo/xamarin.gpg;
sudo apt-key add xamarin.pgp;
sudo sh -c 'echo "deb http://download.mono-project.com/repo/debian wheezy main" >> /etc/apt/sources.list';
sudo sh -c 'echo "deb http://download.mono-project.com/repo/debian wheezy-libtiff-compat main" >> /etc/apt/sources.list';
sudo apt-get update -qq;
sudo apt-get install -qq mono-devel;
curl -L -o ipy-2.7-maint.zip https://github.com/IronLanguages/main/archive/ipy-2.7-maint.zip;
unzip -q ipy-2.7-maint.zip;
pushd main-ipy-2.7-maint;
sed -i '708 s/pGroup/pGroup = null/' 'Languages/IronPython/IronPython.SQLite/c#sqlite/pcache1_c.cs';
xbuild /p:Configuration=Release Solutions/IronPython.sln;
export IPY="${PWD}/bin/Release/ipy.exe";
export IRONPYTHONPATH="${PWD}/External.LCA_RESTRICTED/Languages/IronPython/27/Lib";
popd;
curl -L -o decorator-3.4.0.tar.gz https://pypi.python.org/packages/source/d/decorator/decorator-3.4.0.tar.gz;
tar xf decorator-3.4.0.tar.gz;
cp decorator-3.4.0/src/decorator.py "${IRONPYTHONPATH}";
curl -L -o enum34-1.0.tar.gz https://pypi.python.org/packages/source/e/enum34/enum34-1.0.tar.gz;
tar xf enum34-1.0.tar.gz;
cp enum34-1.0/enum/enum.py "${IRONPYTHONPATH}";
curl -L -o nose-1.3.4.tar.gz https://pypi.python.org/packages/source/n/nose/nose-1.3.4.tar.gz;
tar xf nose-1.3.4.tar.gz;
cp -R nose-1.3.4/nose "${IRONPYTHONPATH}";
popd;
fi
install:
### Install any prerequisites or dependencies necessary to run the build.
- if [[ "${OPTIONAL_DEPS}" == miniconda ]]; then
DEPS="pyyaml numpy scipy matplotlib Cython pandas pip";
sudo apt-get install -qq libatlas-dev libatlas-base-dev liblapack-dev gfortran libsuitesparse-dev;
sudo apt-get install libgdal-dev;
conda create -n test-environment python=$TRAVIS_PYTHON_VERSION $DEPS gdal;
conda install -n test-environment --channel https://conda.binstar.org/patricksnape scikits-sparse;
source activate test-environment;
python -c "from osgeo import ogr;print('importing ogr worked')";
if [[ "${TRAVIS_PYTHON_VERSION}" =~ "2.7" ]]; then
sudo apt-get install graphviz;
pip install pygraphviz pydot2;
fi;
fi
- if [[ "${PYTHON_VM}" != ipy ]]; then
pip install --upgrade nose coverage coveralls;
fi
script:
- printenv PWD
- if [[ "${PYTHON_VM}" != ipy ]]; then
pip install .;
export NX_INSTALL=`pip show networkx | grep Location | awk '{print $2"/networkx"}'`;
fi
# nose 1.3.0 does not tell coverage to only cover the requested
# package (except during the report). So to restrict coverage, we must
# inform coverage through the .coveragerc file.
- if [[ "${PYTHON_VM}" != ipy ]]; then
cp .coveragerc $NX_INSTALL;
cp setup.cfg $NX_INSTALL;
fi
# Move to new directory so that networkx is not imported from repository.
# Why? Because we want the tests to make sure that NetworkX was installed
# correctly. Example: setup.py might not have included some submodules.
# Testing from the git repository cannot catch a mistake like that.
#
# Export current directory for logs.
- if [[ "${PYTHON_VM}" != ipy ]]; then
cd $NX_INSTALL;
printenv PWD;
fi
# Run nosetests.
- if [[ "${PYTHON_VM}" != ipy ]]; then
if [[ "${PYTHON_VM}" == pypy ]]; then
nosetests --verbosity=2;
else
nosetests --verbosity=2 --with-coverage --cover-package=networkx;
fi;
else
mono "${IPY}" -X:ExceptionDetail -X:FullFrames -c 'from nose import main; main()' \--verbosity=2;
fi
after_success:
# `coveralls` needs to be run from the git repository, and it requires
# the .coverage file that was generated during the testing phase. The
# .coverage file stores absolute paths to the modules, and since we ran
# tests from the installed directory, the paths do not point to files in
# the git repository. Although this does not affect reported statistics,
# it does prevent coveralls from providing more detailed information on
# each file. So the paths in .coverage must be modified to match the
# repository paths. This is what `fixcoverage.py` does.
#
# Report coverage for 2.7 and 3.4 miniconda runs only.
- if [[ "${PYTHON_VM}" != ipy ]]; then
cp .coverage $TRAVIS_BUILD_DIR;
cd $TRAVIS_BUILD_DIR;
if [[ "${TRAVIS_PYTHON_VERSION}${OPTIONAL_DEPS}" =~ 2\.7miniconda|3\.4miniconda ]]; then
python fixcoverage.py ".*/networkx/" "$TRAVIS_BUILD_DIR/networkx/";
coveralls;
fi;
fi
notifications:
email: false