Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
129 changes: 109 additions & 20 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,47 +4,136 @@ env:
global:
- NUMPY=numpy
- MPL=matplotlib
- PYPROJ=pyproj
- TEST_ARGS=--no-pep8
- BUILD_LIBGEOS=false

# install apt binary packages
addons:
apt:
packages:
- libgeos-3.3.8
# matplotlib requirements
- libpng12-dev
- libfreetype6-dev
# helpers utilities
- autotools-dev
- wget

language: python

cache: pip


# matrix generates 6 test cases
matrix:
include:
# "minimum requirements" environments
# test the bare minimum versions
# compiles internal libgeos
# Notes:
# numpy 1.7.0 is the first version that works out of the box for Python 2.6 and 3.3
# numpy 1.5.1 is the earliest version to compile and *might* be able to work on Python 2.6,
# if two unit tests are skipped due to numpy.copy(a,order) not having 'order' parameter
# 1.6.0-1.6.2 works out of the box for Python 2.6
# matplotlib 1.2.0 was found to be the earliest version that installs
- python: 2.6
env: NUMPY=numpy==1.6
- python: 2.7
env:
- NUMPY=numpy==1.7.0
- MPL=matplotlib==1.2.0
- BUILD_LIBGEOS=internal
- python: 3.3
env:
- NUMPY=numpy==1.7.0
- MPL=matplotlib==1.2.0
- BUILD_LIBGEOS=internal

# "middle of the road" environment
# use prepackaged binaries
# if no prepackaged binary available, use a previous stable version
- python: 3.4
env:
- MPL=matplotlib==1.4.3
# - NUMPY="numpy>=1.9.0,<1.10.0" # use the default install of numpy

# "latest and greatest" stable environments
# this uses the current stable versions
# pip installs latest stable versions automatically
- python: 2.7
env:
- BUILD_LIBGEOS=3.5.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than hardcoding the latest version which will for sure fall out off sync I would suggest these envs to pass --upgrade to pip that way we are sure that the latest version is installed.

- python: 3.5
# - python: 2.7
# env: TEST_ARGS=--pep8
env:
- BUILD_LIBGEOS=3.5.0

# "current development" environment
# this test is diagnostic for development versions and is not required to pass
- python: "nightly"
env:
# these are python packages so prepend "git+" to git URL
- NUMPY=git+https://github.com/numpy/numpy.git
- MPL=git+https://github.com/matplotlib/matplotlib.git
- PYPROJ=git+https://github.com/jswhit/pyproj.git
# C lib, git URL only
- BUILD_LIBGEOS=https://github.com/libgeos/libgeos.git
# or download latest stable
# - BUILD_LIBGEOS=3.5.0

allow_failures:
- python: "nightly"

before_install:
# before_install:
# Install into our own pristine virtualenv
- virtualenv --python=python venv
- source venv/bin/activate
# - virtualenv --python=python venv
# - source venv/bin/activate

install:
# Upgrade pip and setuptools. Mock has issues with the default version of
# setuptools
- |
pip install --upgrade pip
pip install --upgrade setuptools
pip install $NUMPY
pip install $MPL
pip install -r requirements.txt

- pip install --upgrade pip
- pip install --upgrade setuptools

# the development version of numpy requires Cython
- if [[ $TRAVIS_PYTHON_VERSION == 'nightly' ]]; then pip install --install-option="--no-cython-compile" Cython; fi

# workaround for "middle of the road" configuration to use pre-installed numpy, others "upgrade" numpy
- if [[ $TRAVIS_PYTHON_VERSION != '3.4' ]]; then pip install --upgrade $NUMPY; fi

- pip install --upgrade $MPL
- pip install --upgrade $PYPROJ
- pip install -r requirements.txt

# extra requirements to support Python 2.6
- if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then pip install -r .requirements-2.6.txt; fi

# compile GEOS internally or download external version to compile
- |
cd geos-3.3.3
export GEOS_DIR=$HOME/.local/
./configure --prefix=$GEOS_DIR
make; make install
cd ..
if [[ $BUILD_LIBGEOS != 'false' ]]; then
if [[ $BUILD_LIBGEOS == 'internal' ]]; then
echo 'Building internal libgeos'
cd geos-3.3.3
# does this string contain a "git" substring?
elif [[ $BUILD_LIBGEOS == *"git"* ]]; then
echo 'Using git to download libgeos development'
git clone ${BUILD_LIBGEOS}
cd libgeos
./autogen.sh
else
echo 'Downloading and building external libgeos'
wget https://github.com/libgeos/libgeos/archive/${BUILD_LIBGEOS}.tar.gz
tar zxf ${BUILD_LIBGEOS}.tar.gz
cd libgeos-${BUILD_LIBGEOS}
./autogen.sh
fi
export GEOS_DIR=$HOME/.local/
./configure --prefix=$GEOS_DIR
make; make install
cd ..
fi
# - pip install pep8
- python setup.py install
- pip install .

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