[tox]
envlist=
    # core python/django/database
    py{27,33,34}-dj{18,19}-{sqlite,mysql,postgres},
    # contrib
    py{27,33,34}-dj{18,19}-contrib-{sqlite,mysql,postgres},
    # javascript
    javascript
[testenv]
basepython=
  py27: python2.7
  py33: python3.4
  py34: python3.4
commands=
  contrib: pip install -e .[page_builder,widgy_mezzanine,form_builder] --log-file {envdir}/pip-extras-require-log.log
  py.test {posargs}
setenv=
  DJANGO_SETTINGS_MODULE=tests.settings
  sqlite: DATABASE_URL=sqlite:///test_db.sqlite3
  postgres: DATABASE_URL=postgres://postgres:@127.0.0.1:5432/widgy
  mysql: DATABASE_URL=mysql://root:@127.0.0.1:3306/widgy
  contrib: DJANGO_SETTINGS_MODULE=tests.settings_contrib
install_command = pip install {packages}
deps=
  dj18: Django>=1.8,<1.9
  dj19: Django>=1.9,<1.10
  mysql: mysqlclient
  postgres: psycopg2
  # Intentionaly no space between -r{toxinidir} because tox falls over if there is a space.
  -r{toxinidir}/requirements-test.txt
whitelist_externals=
  env
  make

[testenv:javascript]
basepython=python2.7
commands=
  /usr/bin/env
  make test-js
setenv=
  # Needed by node-gyp, a dependency of contextify from jsdom.
  # Development files for node addons are downloaded to $HOME/.node-gyp.
  # https://github.com/TooTallNate/node-gyp/issues/21
  HOME=/home/travis
skipsdist=true
deps=
