language: python

python:
  - 2.7

services:
  - postgresql

install:
  # Add PPAs for GEOS 3.3.x and PostGIS 2.x
  - sudo apt-add-repository -y ppa:sharpie/for-science
  - sudo apt-add-repository -y ppa:sharpie/postgis-nightly
  - sudo apt-get update

  # Install PostGIS
  - sudo apt-get install postgresql-9.1-postgis postgresql-contrib-9.1 -q

  # Install SkyLines Python dependencies
  - pip install -e .

  # Install testing dependencies
  - pip install -r requirements.txt
  - pip install rednose

before_script:
  # Create the testing database
  - psql -U postgres -c 'CREATE DATABASE skylines_test;'

  # Install PostGIS extension into the database
  - psql -U postgres -d skylines_test -c 'CREATE EXTENSION postgis;'
  - psql -U postgres -d skylines_test -f /usr/share/postgresql/9.1/contrib/postgis-2.1/legacy_minimal.sql

  # Install fuzzystrmatch extension into the database
  - psql -U postgres -d skylines_test -c 'CREATE EXTENSION fuzzystrmatch;'

script:
  # Run the test suite
  - nosetests --rednose --verbose

notifications:
  email:
    on_failure: change
  irc:
    channels:
      - "irc.freenode.org#skylines"
    on_success: change
    on_failure: always
    use_notice: true
    skip_join: true

language: python

python:
  - 2.7

services:
  - postgresql

install:
  # Add PPAs for GEOS 3.3.x and PostGIS 2.x
  - sudo apt-add-repository -y ppa:ubuntugis/ppa
  - sudo apt-get update

  # Install PostGIS
  - sudo apt-get install postgresql-9.1-postgis postgresql-contrib-9.1 -q

  # Install SkyLines Python dependencies
  - pip install -e .

  # Install testing dependencies
  - pip install -r requirements.txt
  - pip install rednose

before_script:
  # Create the testing database
  - psql -U postgres -c 'CREATE DATABASE skylines_test;'

  # Install PostGIS extension into the database
  - psql -U postgres -d skylines_test -c 'CREATE EXTENSION postgis;'
  - psql -U postgres -d skylines_test -f /usr/share/postgresql/9.1/contrib/postgis-2.0/legacy_minimal.sql

  # Install fuzzystrmatch extension into the database
  - psql -U postgres -d skylines_test -c 'CREATE EXTENSION fuzzystrmatch;'

script:
  # Run the test suite
  - nosetests --rednose --verbose

notifications:
  email:
    on_failure: change
  irc:
    channels:
      - "irc.freenode.org#skylines"
    on_success: change
    on_failure: always
    use_notice: true
    skip_join: true

Use ppa:ubuntugis/ppa instead of ppa:sharpie
TravisCI: Use ppa:ubuntugis/ppa instead of ppa:sharpie
