language: python

python:
  - "3.3"
  - "3.4"

before_install:
  - sudo apt-get update
  - sudo /etc/init.d/postgresql stop
  - sudo apt-get install -y postgresql-contrib-9.3
  - sudo /etc/init.d/postgresql start 9.3

install:
  - python setup.py install
  - pip install pyflakes
  - pip install pep8
  - pip install docutils
  - test $USE_SA == 1 && pip install sqlalchemy || true

before_script:
  - psql -c "create database aiopg;" -U postgres
  - psql -c "create user aiopg with password 'passwd';" -U postgres
  - psql -c "grant all privileges on database aiopg to aiopg;" -U postgres
  - psql -c "create extension hstore;" -U postgres -d aiopg

script:
  - pep8 aiopg examples tests
  - pyflakes .
  - python runtests.py -v
  - python setup.py check -rms

#addons:
#  postgresql: "9.4"

env:
  global:
    - PYTHON=python
  matrix:
    - USE_SA=1 PYTHONASYNCIODEBUG=1
    - USE_SA=0 PYTHONASYNCIODEBUG=1
    - USE_SA=1 PYTHONASYNCIODEBUG=0
    - USE_SA=0 PYTHONASYNCIODEBUG=0

cache: apt

language: python

python:
  - "3.3"
  - "3.4"

before_install:
  - sudo apt-get update
  - sudo /etc/init.d/postgresql stop
  - sudo apt-get install -y postgresql-contrib-${PG}
  - sudo /etc/init.d/postgresql start ${PG}

install:
  - python setup.py install
  - pip install pyflakes
  - pip install pep8
  - pip install docutils
  - test $USE_SA == 1 && pip install sqlalchemy || true

before_script:
  - psql -c "create database aiopg;" -U postgres
  - psql -c "create user aiopg with password 'passwd';" -U postgres
  - psql -c "grant all privileges on database aiopg to aiopg;" -U postgres
  - psql -c "create extension hstore;" -U postgres -d aiopg

script:
  - pep8 aiopg examples tests
  - pyflakes .
  - python runtests.py -v
  - python setup.py check -rms

#addons:
#  postgresql: "9.4"

env:
  global:
    - PYTHON=python
  matrix:
    - USE_SA=1 PYTHONASYNCIODEBUG=1 PG=9.3
    - USE_SA=0 PYTHONASYNCIODEBUG=1 PG=9.3
    - USE_SA=1 PYTHONASYNCIODEBUG=0 PG=9.3
    - USE_SA=0 PYTHONASYNCIODEBUG=0 PG=9.3

cache: apt

Use shell var for postgres version
Use shell var for postgres version
