<commit_before>language: python

python:
  - 3.5
  - 3.6

sudo: false

addons:
    postgresql: "9.4"
    apt:
       sources:
       - elasticsearch-2.x
       packages:
       - elasticsearch=2.4.5
       - openjdk-8-jre
       - python-requests
       - python-lxml
       - curl
       - libffi-dev
       - libssl-dev
       - ghostscript

services:
  - postgresql
  - redis
  - elasticsearch

env:
  global:
      # RoMEO API key
    - secure: "<KEY>
      # Zenodo Sandbox API key
    - secure: "<KEY>
    - PIP_DOWNLOAD_CACHE=$HOME/.pip-cache

before_install:
  # Install latest tidy-html5
  - sudo apt-get remove libtidy-0.99-0
  - wget https://github.com/htacg/tidy-html5/releases/download/5.4.0/tidy-5.4.0-64bit.deb
  - sudo dpkg -i tidy-5.4.0-64bit.deb
  # Make imagemagick read pdf
  - sudo sed -i 's/<policy domain="coder" rights="none" pattern="PDF" \/>/<policy domain="coder" rights="read" pattern="PDF" \/>/' /etc/ImageMagick-6/policy.xml
  # Rest
  - export DJANGO_SETTINGS_MODULE=dissemin.settings
  - export PYTHONPATH=$HOME/builds/dissemin/dissemin
  - export PIP_USE_MIRRORS=true
  - echo "from .travis import *" > dissemin/settings/__init__.py
  - cp dissemin/settings/secret_template.py dissemin/settings/secret.py

install:
  - pip install setuptools --upgrade
  - pip install psycopg2 --quiet
  - pip install -r requirements.txt --upgrade
  - pip install -r requirements-dev.txt --upgrade
  - pip install coveralls
  - ./pyflakes.sh
  - pip freeze

before_script:
  - psql --version
  - psql -c "CREATE DATABASE dissemin;" -U postgres
  - if [ $TRAVIS_EVENT_TYPE == 'cron' ]; 
    then
    echo ">= Using all languages in tests because this is trigggered by cron <=";
    export DISSEMIN_TEST_ALL_LANGUAGES="YES";
    else
    echo "=> Using only english language in tests because this is not triggered by cron <=";
    fi

script:
  - python manage.py compilemessages --exclude qqq
  - coverage run --source=dissemin,papers,backend,deposit,upload,statistics --omit="*/migrations/*,dissemin/settings/*" -m py.test

after_success:
  - coveralls<commit_msg>Use vnu server on travis ci<commit_after>language: python

python:
  - 3.5
  - 3.6

sudo: false

addons:
    postgresql: "9.4"
    apt:
       sources:
       - elasticsearch-2.x
       packages:
       - elasticsearch=2.4.5
       - openjdk-8-jre
       - python-requests
       - python-lxml
       - curl
       - libffi-dev
       - libssl-dev
       - ghostscript

services:
  - postgresql
  - redis
  - elasticsearch
  - docker

env:
  global:
      # RoMEO API key
    - secure: "<KEY>
      # Zenodo Sandbox API key
    - secure: "<KEY>
    - PIP_DOWNLOAD_CACHE=$HOME/.pip-cache
    - USE_VNU_SERVER='YES'

before_install:
  # Install latest tidy-html5
  - sudo apt-get remove libtidy-0.99-0
  - wget https://github.com/htacg/tidy-html5/releases/download/5.4.0/tidy-5.4.0-64bit.deb
  - sudo dpkg -i tidy-5.4.0-64bit.deb
  # Make imagemagick read pdf
  - sudo sed -i 's/<policy domain="coder" rights="none" pattern="PDF" \/>/<policy domain="coder" rights="read" pattern="PDF" \/>/' /etc/ImageMagick-6/policy.xml
  # Rest
  - export DJANGO_SETTINGS_MODULE=dissemin.settings
  - export PYTHONPATH=$HOME/builds/dissemin/dissemin
  - export PIP_USE_MIRRORS=true
  - echo "from .travis import *" > dissemin/settings/__init__.py
  - cp dissemin/settings/secret_template.py dissemin/settings/secret.py
  - docker run -d -it --rm -p 8888:8888 validator/validator:latest

install:
  - pip install setuptools --upgrade
  - pip install psycopg2 --quiet
  - pip install -r requirements.txt --upgrade
  - pip install -r requirements-dev.txt --upgrade
  - pip install coveralls
  - ./pyflakes.sh
  - pip freeze

before_script:
  - psql --version
  - psql -c "CREATE DATABASE dissemin;" -U postgres
  - if [ $TRAVIS_EVENT_TYPE == 'cron' ]; 
    then
    echo ">= Using all languages in tests because this is trigggered by cron <=";
    export DISSEMIN_TEST_ALL_LANGUAGES="YES";
    else
    echo "=> Using only english language in tests because this is not triggered by cron <=";
    fi

script:
  - python manage.py compilemessages --exclude qqq
  - coverage run --source=dissemin,papers,backend,deposit,upload,statistics --omit="*/migrations/*,dissemin/settings/*" -m py.test

after_success:
  - coveralls
{'fraction_non_alphanumeric': 0.1224585183454078, 'fraction_numerical': 0.01682636129936901, 'mean_word_length': 2.639455782312925, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 17, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5949008', 'n_tokens_mistral': 1586, 'n_tokens_neox': 1498, 'n_words': 350}