Skip to content

Commit 25fcba6

Browse files
committed
Merge pull request #245 from micahcochran/travis-apt-try2
Use APT for libgeos on Travis
2 parents c8aeba4 + cf33770 commit 25fcba6

File tree

1 file changed

+109
-20
lines changed

1 file changed

+109
-20
lines changed

.travis.yml

Lines changed: 109 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,47 +4,136 @@ env:
44
global:
55
- NUMPY=numpy
66
- MPL=matplotlib
7+
- PYPROJ=pyproj
78
- TEST_ARGS=--no-pep8
9+
- BUILD_LIBGEOS=false
10+
11+
# install apt binary packages
12+
addons:
13+
apt:
14+
packages:
15+
- libgeos-3.3.8
16+
# matplotlib requirements
17+
- libpng12-dev
18+
- libfreetype6-dev
19+
# helpers utilities
20+
- autotools-dev
21+
- wget
822

923
language: python
1024

25+
cache: pip
26+
27+
28+
# matrix generates 6 test cases
1129
matrix:
1230
include:
31+
# "minimum requirements" environments
32+
# test the bare minimum versions
33+
# compiles internal libgeos
34+
# Notes:
35+
# numpy 1.7.0 is the first version that works out of the box for Python 2.6 and 3.3
36+
# numpy 1.5.1 is the earliest version to compile and *might* be able to work on Python 2.6,
37+
# if two unit tests are skipped due to numpy.copy(a,order) not having 'order' parameter
38+
# 1.6.0-1.6.2 works out of the box for Python 2.6
39+
# matplotlib 1.2.0 was found to be the earliest version that installs
1340
- python: 2.6
14-
env: NUMPY=numpy==1.6
15-
- python: 2.7
41+
env:
42+
- NUMPY=numpy==1.7.0
43+
- MPL=matplotlib==1.2.0
44+
- BUILD_LIBGEOS=internal
1645
- python: 3.3
46+
env:
47+
- NUMPY=numpy==1.7.0
48+
- MPL=matplotlib==1.2.0
49+
- BUILD_LIBGEOS=internal
50+
51+
# "middle of the road" environment
52+
# use prepackaged binaries
53+
# if no prepackaged binary available, use a previous stable version
1754
- python: 3.4
55+
env:
56+
- MPL=matplotlib==1.4.3
57+
# - NUMPY="numpy>=1.9.0,<1.10.0" # use the default install of numpy
58+
59+
# "latest and greatest" stable environments
60+
# this uses the current stable versions
61+
# pip installs latest stable versions automatically
62+
- python: 2.7
63+
env:
64+
- BUILD_LIBGEOS=3.5.0
1865
- python: 3.5
19-
# - python: 2.7
20-
# env: TEST_ARGS=--pep8
66+
env:
67+
- BUILD_LIBGEOS=3.5.0
68+
69+
# "current development" environment
70+
# this test is diagnostic for development versions and is not required to pass
71+
- python: "nightly"
72+
env:
73+
# these are python packages so prepend "git+" to git URL
74+
- NUMPY=git+https://github.com/numpy/numpy.git
75+
- MPL=git+https://github.com/matplotlib/matplotlib.git
76+
- PYPROJ=git+https://github.com/jswhit/pyproj.git
77+
# C lib, git URL only
78+
- BUILD_LIBGEOS=https://github.com/libgeos/libgeos.git
79+
# or download latest stable
80+
# - BUILD_LIBGEOS=3.5.0
81+
82+
allow_failures:
83+
- python: "nightly"
2184

22-
before_install:
85+
# before_install:
2386
# Install into our own pristine virtualenv
24-
- virtualenv --python=python venv
25-
- source venv/bin/activate
87+
# - virtualenv --python=python venv
88+
# - source venv/bin/activate
2689

2790
install:
2891
# Upgrade pip and setuptools. Mock has issues with the default version of
2992
# setuptools
30-
- |
31-
pip install --upgrade pip
32-
pip install --upgrade setuptools
33-
pip install $NUMPY
34-
pip install $MPL
35-
pip install -r requirements.txt
36-
93+
- pip install --upgrade pip
94+
- pip install --upgrade setuptools
95+
96+
# the development version of numpy requires Cython
97+
- if [[ $TRAVIS_PYTHON_VERSION == 'nightly' ]]; then pip install --install-option="--no-cython-compile" Cython; fi
98+
99+
# workaround for "middle of the road" configuration to use pre-installed numpy, others "upgrade" numpy
100+
- if [[ $TRAVIS_PYTHON_VERSION != '3.4' ]]; then pip install --upgrade $NUMPY; fi
101+
102+
- pip install --upgrade $MPL
103+
- pip install --upgrade $PYPROJ
104+
- pip install -r requirements.txt
105+
106+
# extra requirements to support Python 2.6
37107
- if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then pip install -r .requirements-2.6.txt; fi
38108

109+
# compile GEOS internally or download external version to compile
39110
- |
40-
cd geos-3.3.3
41-
export GEOS_DIR=$HOME/.local/
42-
./configure --prefix=$GEOS_DIR
43-
make; make install
44-
cd ..
111+
if [[ $BUILD_LIBGEOS != 'false' ]]; then
112+
if [[ $BUILD_LIBGEOS == 'internal' ]]; then
113+
echo 'Building internal libgeos'
114+
cd geos-3.3.3
115+
# does this string contain a "git" substring?
116+
elif [[ $BUILD_LIBGEOS == *"git"* ]]; then
117+
echo 'Using git to download libgeos development'
118+
git clone ${BUILD_LIBGEOS}
119+
cd libgeos
120+
./autogen.sh
121+
else
122+
echo 'Downloading and building external libgeos'
123+
wget https://github.com/libgeos/libgeos/archive/${BUILD_LIBGEOS}.tar.gz
124+
tar zxf ${BUILD_LIBGEOS}.tar.gz
125+
cd libgeos-${BUILD_LIBGEOS}
126+
./autogen.sh
127+
fi
128+
export GEOS_DIR=$HOME/.local/
129+
./configure --prefix=$GEOS_DIR
130+
make; make install
131+
cd ..
132+
fi
45133
# - pip install pep8
46-
- python setup.py install
134+
- pip install .
47135

48136
script:
49137
- python lib/mpl_toolkits/basemap/test.py --verbose
50138

139+

0 commit comments

Comments
 (0)