@@ -22,7 +22,12 @@ addons:
22
22
23
23
language : python
24
24
25
- cache : pip
25
+ cache :
26
+ directories :
27
+ # cache for wheels generated by pip
28
+ - $HOME/.cache/pip
29
+ # cache for libgeos library binaries
30
+ - $HOME/.libgeos
26
31
27
32
28
33
# matrix generates 6 test cases
@@ -54,7 +59,7 @@ matrix:
54
59
- python : 3.4
55
60
env :
56
61
- MPL=matplotlib==1.4.3
57
- # - NUMPY=" numpy>= 1.9.0,<1.10.0" # use the default install of numpy
62
+ - NUMPY=numpy== 1.9.3
58
63
59
64
# "latest and greatest" stable environments
60
65
# this uses the current stable versions
@@ -88,47 +93,52 @@ matrix:
88
93
# - source venv/bin/activate
89
94
90
95
install :
91
- # Upgrade pip and setuptools. Mock has issues with the default version of
92
- # setuptools
96
+ # Upgrade pip and setuptools. Install wheel.
93
97
- pip install --upgrade pip
94
- - pip install --upgrade setuptools
98
+ - pip install --upgrade setuptools
99
+ - pip install wheel
95
100
96
101
# the development version of numpy requires Cython
97
102
- if [[ $TRAVIS_PYTHON_VERSION == 'nightly' ]]; then pip install --install-option="--no-cython-compile" Cython; fi
98
103
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
104
102
- - pip install --upgrade $MPL
103
- - pip install --upgrade $PYPROJ
105
+ - pip install --upgrade $NUMPY
106
+ - pip install $MPL
107
+ - pip install $PYPROJ
104
108
- pip install -r requirements.txt
105
109
106
110
# extra requirements to support Python 2.6
107
111
- if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then pip install -r .requirements-2.6.txt; fi
108
112
109
- # compile GEOS internally or download external version to compile
110
113
- |
114
+ # Is libgeos suppose to be built?
111
115
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
116
+ export GEOS_DIR=$HOME/.libgeos/${BUILD_LIBGEOS}/
117
+ # Does this path (for libgeos binaries) not exist in cache?
118
+ if [[ ! -d "$GEOS_DIR" ]] ; then
119
+ # Download and Compile libgeos
120
+ if [[ $BUILD_LIBGEOS == 'internal' ]]; then
121
+ echo 'Building internal libgeos'
122
+ cd geos-3.3.3
123
+ # Does this string contain a "git" substring?
124
+ elif [[ $BUILD_LIBGEOS == *"git"* ]]; then
125
+ echo 'Using git to download libgeos development'
126
+ git clone ${BUILD_LIBGEOS}
127
+ cd libgeos
128
+ ./autogen.sh
129
+ # do NOT cache libgeos git
130
+ export GEOS_DIR=$HOME/dont-cache-me/
131
+ else
132
+ echo 'Downloading and building external libgeos'
133
+ wget https://github.com/libgeos/libgeos/archive/${BUILD_LIBGEOS}.tar.gz
134
+ tar zxf ${BUILD_LIBGEOS}.tar.gz
135
+ cd libgeos-${BUILD_LIBGEOS}
136
+ ./autogen.sh
137
+ fi
138
+ ./configure --prefix=$GEOS_DIR
139
+ make; make install
140
+ cd ..
127
141
fi
128
- export GEOS_DIR=$HOME/.local/
129
- ./configure --prefix=$GEOS_DIR
130
- make; make install
131
- cd ..
132
142
fi
133
143
# - pip install pep8
134
144
- pip install .
0 commit comments