<commit_before>notifications:
  email: false
  irc:
    channels:
      - "irc.mysociety.org#pmo"
    use_notice: true

language: python

env:
  - MODULES="Django>=1.6,<1.7"

services:
  - elasticsearch

install:
  - sudo apt-get update -qq
  # The following steps are taken from MapIt's travis.yml, to make
  # sure that the system python-gdal is used - installing it with pip
  # will fail due to build errors.
  - sudo apt-get install -qq libgdal1-dev libgdal1-1.7.0 python-gdal gdal-bin binutils
  - ln -s /usr/lib/python2.7/dist-packages/osgeo ~/virtualenv/python2.7/lib/python2.7/site-packages/
  - ln -s /usr/lib/python2.7/dist-packages/GDAL-1.7.3.egg-info ~/virtualenv/python2.7/lib/python2.7/site-packages/
  # Install the environment-specific Python packages:
  - pip install $MODULES --use-mirrors
  # Now install the rest of the required Python packages:
  - pip install -r requirements.txt --use-mirrors
  # Create the PostGIS template database:
  - createdb -E UTF8 template_postgis &&
    ( createlang -d template_postgis -l | grep plpgsql || createlang -d template_postgis plpgsql ) &&
    psql -d postgres -c "UPDATE pg_database SET datistemplate='true' WHERE datname='template_postgis';" &&
    psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-2.1/postgis.sql &&
    psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-2.1/spatial_ref_sys.sql &&
    psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-2.1/legacy_gist.sql &&
    psql -d template_postgis -c "GRANT ALL ON geometry_columns TO PUBLIC;" &&
    psql -d template_postgis -c "GRANT ALL ON spatial_ref_sys TO PUBLIC;" &&
    psql -d template_postgis -c "GRANT ALL ON geography_columns TO PUBLIC;"
  - sudo /etc/init.d/postgresql reload
  # Create a basic general.yml file:
  - sed -r
    -e "s,(POMBOLA_DB_USER:) 'sayit',\\1 'postgres',"
    -e "s,(POMBOLA_DB_NAME:) '',\\1 'pombola',"
    -e "s,(DJANGO_SECRET_KEY:) '',\\1 'notatallsecret',"
    conf/general.yml-example > conf/general.yml

before_script:
  - createdb -U postgres -T template_postgis pombola
  - ./manage.py syncdb --noinput
  - ./manage.py migrate --noinput
  - ./manage.py collectstatic --noinput

script:
  - ./run-tests<commit_msg>.travis.yml: Simplify the PostGIS database creation<commit_after>notifications:
  email: false
  irc:
    channels:
      - "irc.mysociety.org#pmo"
    use_notice: true

language: python

env:
  - MODULES="Django>=1.6,<1.7"

services:
  - elasticsearch

install:
  - sudo apt-get update -qq
  # The following steps are taken from MapIt's travis.yml, to make
  # sure that the system python-gdal is used - installing it with pip
  # will fail due to build errors.
  - sudo apt-get install -qq libgdal1-dev libgdal1-1.7.0 python-gdal gdal-bin binutils
  - ln -s /usr/lib/python2.7/dist-packages/osgeo ~/virtualenv/python2.7/lib/python2.7/site-packages/
  - ln -s /usr/lib/python2.7/dist-packages/GDAL-1.7.3.egg-info ~/virtualenv/python2.7/lib/python2.7/site-packages/
  # Install the environment-specific Python packages:
  - pip install $MODULES --use-mirrors
  # Now install the rest of the required Python packages:
  - pip install -r requirements.txt --use-mirrors
  # Create a basic general.yml file:
  - sed -r
    -e "s,(POMBOLA_DB_USER:) 'sayit',\\1 'postgres',"
    -e "s,(POMBOLA_DB_NAME:) '',\\1 'pombola',"
    -e "s,(DJANGO_SECRET_KEY:) '',\\1 'notatallsecret',"
    conf/general.yml-example > conf/general.yml

before_script:
  - createdb -U postgres pombola
  - psql -c 'CREATE EXTENSION postgis;' -U postgres -d pombola
  - ./manage.py syncdb --noinput
  - ./manage.py migrate --noinput
  - ./manage.py collectstatic --noinput

script:
  - ./run-tests
{'fraction_non_alphanumeric': 0.13263101026472177, 'fraction_numerical': 0.018098325229605618, 'mean_word_length': 3.1328125, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7335697', 'n_tokens_mistral': 1428, 'n_tokens_neox': 1378, 'n_words': 338}