Skip to content

Commit 068787e

Browse files
committed
Multiple install environments
Downloads and compiles external version of libgeos from github. Installs version that are "latest and greatest", "middle of the road", "minimum requirements", and "current development" environment. The "middle of the road" Python 3.4. Gets everything done in less than 3 minutes. The "current development" environment is allowed to fail. It is more of a diagnostic to address future possible incompatibilities. For the "minimum requirements" environment, this took a bit of testing. The earliest versions that I could get to work on Python 2.6 and 3.3 were matplotlib 1.2.0 and numpy 1.7.0. Python 2.6 did work with earlier versions of numpy. If desired, a travis test matrix could be built to test out all the possibilities to truly find the minimum. See config for details. Total build time is similar to before this, but this tests the boundaries a bit more. There is more work that could be done, but I think this is a completely better system from the current.
1 parent 90cfe50 commit 068787e

File tree

1 file changed

+93
-27
lines changed

1 file changed

+93
-27
lines changed

.travis.yml

Lines changed: 93 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,39 +4,83 @@ env:
44
global:
55
- NUMPY=numpy
66
- MPL=matplotlib
7+
- PYPROJ=pyproj
78
- TEST_ARGS=--no-pep8
9+
- BUILD_LIBGEOS=false
810

911
language: python
1012

11-
# make subsequent builds happen really fast
1213
cache: pip
1314

14-
addons:
15-
apt:
16-
packages:
17-
- libgeos-3.3.8
18-
# requirements for matplotlib
19-
- libpng12-dev
20-
- libfreetype6-dev
15+
# install apt binary pacakages early
16+
addons:
17+
apt:
18+
packages:
19+
- libgeos-3.3.8
20+
# matplotlib requirements
21+
- libpng12-dev
22+
- libfreetype6-dev
23+
# helpers utilities
24+
- autotools-dev
25+
- wget
2126

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

4185

4286
# before_install:
@@ -50,23 +94,45 @@ install:
5094
- pip install --upgrade pip
5195
- pip install --upgrade setuptools
5296

97+
# the development version of numpy requires Cython
98+
- if [[ $TRAVIS_PYTHON_VERSION == '3.5-dev' ]]; then pip install --install-option="--no-cython-compile" Cython; fi
99+
# workaround to get the specified numpy version to install on Python 2.7
100+
- if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then pip install --upgrade $NUMPY; fi
101+
53102
- pip install $NUMPY
54103
- pip install $MPL
104+
- pip install $PYPROJ
55105
- pip install -r requirements.txt
56-
106+
107+
# extra requirements to support Python 2.6
57108
- if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then pip install -r .requirements-2.6.txt; fi
58109

110+
# compile GEOS internally or download external version to compile
59111
- |
60-
if [[ $BUILD_INTERNAL_GEOS == 'true' ]]
61-
then
112+
if [[ $BUILD_LIBGEOS != 'false' ]]; then
113+
if [[ $BUILD_LIBGEOS == 'internal' ]]; then
114+
echo 'Building internal libgeos'
62115
cd geos-3.3.3
63-
export GEOS_DIR=$HOME/.local/
64-
./configure --prefix=$GEOS_DIR
65-
make; make install
66-
cd ..
116+
# does this string contain a "git" substring?
117+
elif [[ $BUILD_LIBGEOS == *"git"* ]]; then
118+
echo 'Using git to download libgeos development'
119+
git clone ${BUILD_LIBGEOS}
120+
cd libgeos
121+
./autogen.sh
122+
else
123+
echo 'Downloading and building external libgeos'
124+
wget https://github.com/libgeos/libgeos/archive/${BUILD_LIBGEOS}.tar.gz
125+
tar zxf ${BUILD_LIBGEOS}.tar.gz
126+
cd libgeos-${BUILD_LIBGEOS}
127+
./autogen.sh
128+
fi
129+
export GEOS_DIR=$HOME/.local/
130+
./configure --prefix=$GEOS_DIR
131+
make; make install
132+
cd ..
67133
fi
68134
# - pip install pep8
69-
- python setup.py install
135+
- pip install .
70136

71137
script:
72138
- python lib/mpl_toolkits/basemap/test.py --verbose

0 commit comments

Comments
 (0)