<commit_before># Travis CI configuration file for imageio
# Validate this at http://lint.travis-ci.org/

language: python
sudo: false
addons:
  apt:
    packages:
    - libfreeimage3

python:
    # - We do unit tests in all envs
    # - Style tests only in 2.7
    # - Image test (todo)
    
    #- "pypy3"  numpy support is really bad right now
    - "2.6"  # lowest that we want to support
    - "2.7"  # native Python, has numpy, runs unit tests of installed imageio
    - "3.4"  # coverage is produced here
    - "3.3"  # Test only style on this machine

before_install:
    - REDIRECT_TO=/dev/stdout  # change to /dev/null to silence Travis
    # Install miniconda
    - if [ "${TRAVIS_PYTHON_VERSION}" == "2.6" ] || [ "${TRAVIS_PYTHON_VERSION}" == "3.4" ]; then
        wget -q http://repo.continuum.io/miniconda/Miniconda-3.7.0-Linux-x86_64.sh -O miniconda.sh;
        chmod +x miniconda.sh;
        ./miniconda.sh -b -p ~/anaconda &> ${REDIRECT_TO};
        export PATH=~/anaconda/bin:$PATH;
        conda update --yes --quiet conda &> ${REDIRECT_TO};
      fi;
    - SRC_DIR=$(pwd)
    # file size checks
    - if [ "${TRAVIS_PYTHON_VERSION}" == "3.3" ]; then
        if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then
          GIT_TARGET_EXTRA="+refs/heads/${TRAVIS_BRANCH}";
          GIT_SOURCE_EXTRA="+refs/pull/${TRAVIS_PULL_REQUEST}/merge";
        else
          GIT_TARGET_EXTRA="";
          GIT_SOURCE_EXTRA="";
        fi;
        cd ~;
        mkdir target-size-clone && cd target-size-clone;
        git init &> ${REDIRECT_TO} && git remote add -t ${TRAVIS_BRANCH} origin git://github.com/${TRAVIS_REPO_SLUG}.git &>${REDIRECT_TO};
        git fetch origin ${GIT_TARGET_EXTRA} &> ${REDIRECT_TO} && git checkout -qf FETCH_HEAD &> ${REDIRECT_TO} && cd ..;
        TARGET_SIZE=`du -s target-size-clone | sed -e "s/\t.*//"`;
        mkdir source-size-clone && cd source-size-clone;
        git init &> ${REDIRECT_TO} && git remote add -t ${TRAVIS_BRANCH} origin git://github.com/${TRAVIS_REPO_SLUG}.git &> ${REDIRECT_TO};
        git fetch origin ${GIT_SOURCE_EXTRA} &> ${REDIRECT_TO} && git checkout -qf FETCH_HEAD &> ${REDIRECT_TO} && cd ..;
        SOURCE_SIZE=`du -s source-size-clone | sed -e "s/\t.*//"`;
        if [ "${SOURCE_SIZE}" != "${TARGET_SIZE}" ]; then
          SIZE_DIFF=`expr ${SOURCE_SIZE} - ${TARGET_SIZE}`;
        else
          SIZE_DIFF=0;
        fi;
      fi;
    - cd ${SRC_DIR}

install:
    # Install Python with numpy
    - if [ "${TRAVIS_PYTHON_VERSION}" == "2.6" ] || [ "${TRAVIS_PYTHON_VERSION}" == "3.4" ]; then
        conda create -n testenv --yes --quiet pip python=$TRAVIS_PYTHON_VERSION > ${REDIRECT_TO};
        source activate testenv > ${REDIRECT_TO};
        conda install --yes --quiet numpy > ${REDIRECT_TO};
      fi;
    # Install dependencies (also for testing)
    - if [ "${TRAVIS_PYTHON_VERSION}" == "3.3" ]; then
        pip install -q flake8;
        pip install -q sphinx;
      else
        pip install -q pytest pytest-cov;
        pip install -q coveralls;
      fi;
    # Install optional dependencies
    - if [ "${TRAVIS_PYTHON_VERSION}" == "3.4" ]; then
       easy_install -q simpleitk; true;
       conda install -y gdal astropy;
      fi;
    # Install imageio, use installed version on only one machine
    - python setup.py build_with_fi install > ${REDIRECT_TO}

before_script:

script: 
    - python -c "import sys; print(sys.version, '\n', sys.prefix)";
    # Run unit tests or style test
    - if [ "${TRAVIS_PYTHON_VERSION}" == "3.3" ]; then
        echo "Size difference ${SIZE_DIFF} kB";
        test ${SIZE_DIFF} -lt 100;
        python make test style;
        python make doc html;
      elif [ "${TRAVIS_PYTHON_VERSION}" == "2.7" ]; then
        python make test installed;
      else
        python make test unit;
      fi;

after_success:
    - echo == ALL TESTS PASS ==
    - if [ "${TRAVIS_PYTHON_VERSION}" == "3.4" ]; then
        coveralls;
      fi;

after_failure:
    - echo == FAILURE ==

after_script:<commit_msg>travis test 3.5<commit_after># Travis CI configuration file for imageio
# Validate this at http://lint.travis-ci.org/

language: python

sudo: false

addons:
  apt:
    packages:
    - libfreeimage3

# Only run travis build on push for master branch
branches:
  only:
    - master

matrix:
    include:
        - python: "3.5"
          env: TEST_UNIT=0 TEST_STYLE=1
        #
        - python: "2.6"
          env: TEST_UNIT=1
        - python: "2.7"
          env: TEST_UNIT=1 TEST_INSTALL=1
        - python: "3.4"
          env: TEST_UNIT=1 TEST_FULL=1 TEST_COVER=1
        - python: "3.5"
          env: TEST_UNIT=1


before_install:
    - REDIRECT_TO=/dev/stdout  # change to /dev/null to silence Travis
    # Install miniconda
    - if [ "${TEST_UNIT}" == "1" ]; then
        wget -q http://repo.continuum.io/miniconda/Miniconda-3.7.0-Linux-x86_64.sh -O miniconda.sh;
        chmod +x miniconda.sh;
        ./miniconda.sh -b -p ~/anaconda &> ${REDIRECT_TO};
        export PATH=~/anaconda/bin:$PATH;
        conda update --yes --quiet conda &> ${REDIRECT_TO};
      fi;
    - SRC_DIR=$(pwd)
    # file size checks
    - if [ "${TEST_STYLE}" == "1" ]; then
        if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then
          GIT_TARGET_EXTRA="+refs/heads/${TRAVIS_BRANCH}";
          GIT_SOURCE_EXTRA="+refs/pull/${TRAVIS_PULL_REQUEST}/merge";
        else
          GIT_TARGET_EXTRA="";
          GIT_SOURCE_EXTRA="";
        fi;
        cd ~;
        mkdir target-size-clone && cd target-size-clone;
        git init &> ${REDIRECT_TO} && git remote add -t ${TRAVIS_BRANCH} origin git://github.com/${TRAVIS_REPO_SLUG}.git &>${REDIRECT_TO};
        git fetch origin ${GIT_TARGET_EXTRA} &> ${REDIRECT_TO} && git checkout -qf FETCH_HEAD &> ${REDIRECT_TO} && cd ..;
        TARGET_SIZE=`du -s target-size-clone | sed -e "s/\t.*//"`;
        mkdir source-size-clone && cd source-size-clone;
        git init &> ${REDIRECT_TO} && git remote add -t ${TRAVIS_BRANCH} origin git://github.com/${TRAVIS_REPO_SLUG}.git &> ${REDIRECT_TO};
        git fetch origin ${GIT_SOURCE_EXTRA} &> ${REDIRECT_TO} && git checkout -qf FETCH_HEAD &> ${REDIRECT_TO} && cd ..;
        SOURCE_SIZE=`du -s source-size-clone | sed -e "s/\t.*//"`;
        if [ "${SOURCE_SIZE}" != "${TARGET_SIZE}" ]; then
          SIZE_DIFF=`expr ${SOURCE_SIZE} - ${TARGET_SIZE}`;
        else
          SIZE_DIFF=0;
        fi;
      fi;
    - cd ${SRC_DIR}

install:
    # Install Python with numpy
    - if [ "${TEST_UNIT}" == "1" ]; then
        conda create -n testenv --yes --quiet pip python=$TRAVIS_PYTHON_VERSION > ${REDIRECT_TO};
        source activate testenv > ${REDIRECT_TO};
        conda install --yes --quiet numpy > ${REDIRECT_TO};
      fi;
    # Install dependencies (also for testing)
    - if [ "${TEST_STYLE}" == "1" ]; then
        pip install -q flake8;
        pip install -q sphinx;
      else
        pip install -q pytest pytest-cov;
        pip install -q coveralls;
      fi;
    # Install optional dependencies
    - if [ "${TEST_FULL}" == "1" ]; then
       easy_install -q simpleitk; true;
       conda install -y gdal astropy;
      fi;
    # Install imageio, use installed version on only one machine
    - if [ "${TEST_INSTALL}" == 1" ]; then
       python setup.py build_with_fi install > ${REDIRECT_TO};
      fi;

before_script:

script: 
    - python -c "import sys; print(sys.version, '\n', sys.prefix)";
    # Run unit tests or style test
    - if [ "${TEST_STYLE}" == "1" ]; then
        echo "Size difference ${SIZE_DIFF} kB";
        test ${SIZE_DIFF} -lt 100;
        python make test style;
        python make doc html;
      elif [ "${TEST_INSTALL}" == "1" ]; then
        python make test installed;
      else
        python make test unit;
      fi;

after_success:
    - echo == ALL TESTS PASS ==
    - if [ "${TEST_COVER}" == "1" ]; then
        coveralls;
      fi;

after_failure:
    - echo == FAILURE ==

after_script:
{'fraction_non_alphanumeric': 0.14558712597435253, 'fraction_numerical': 0.01093789288408348, 'mean_word_length': 2.3312395309882747, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 31, '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': '7093369', 'n_tokens_mistral': 2818, 'n_tokens_neox': 2790, 'n_words': 710}