<commit_before>language: python
dist: trusty
services:
  - docker

#cache:
#  directories:
#  - $HOME/ScienceTools

notifications:
  email: false

env:
    global:
      - FERMI_DIR=$HOME/ScienceTools/x86_64-unknown-linux-gnu-libc2.19-10
      - SLAC_ST_BUILD=false      
      - PIP_DEPS='coverage pytest-cov coveralls'
      - CONDA2='conda install -y -c conda-forge healpy'
      - INSTALL_CMD='python setup.py install'
      - CONDA_CHANNELS=conda-forge

matrix:
    include:

        # The main build:
        # Python 2, Fermi ST, all dependencies
        - os: linux
          env: NAME=fssc-st-10-00-05
               PYTHON_VERSION=2.7
               CONDA_DOWNLOAD=Miniconda-latest-Linux-x86_64.sh
               ST_INSTALL='bash stinstall.sh force'
               DOCKER_INSTALL=''
               CONDA_DEPS='gammapy numpy astropy scipy matplotlib pytest pyyaml'

        # The Sphinx docs build
        # Python 3, no Fermi ST, all other dependencies
        - os: linux
          env: NAME=docs
               PYTHON_VERSION=3.5
               ST_INSTALL=''
               DOCKER_INSTALL=''
               CONDA_DOWNLOAD=Miniconda3-latest-Linux-x86_64.sh
               CONDA_DEPS='gammapy numpy astropy scipy matplotlib pytest pyyaml sphinx sphinx_rtd_theme'

        # Python 3.5, no Fermi ST, all other dependencies
        - os: linux
          env: NAME=py35_st-no_dep-yes
               PYTHON_VERSION=3.5
               ST_INSTALL=''
               DOCKER_INSTALL=''
               CONDA_DOWNLOAD=Miniconda3-latest-Linux-x86_64.sh
               CONDA_DEPS='gammapy numpy astropy scipy matplotlib pytest pyyaml'

        # Python 3.6, no Fermi ST, all other dependencies
        - os: linux
          env: NAME=py36_st-no_dep-yes
               PYTHON_VERSION=3.6
               ST_INSTALL=''
               DOCKER_INSTALL=''
               CONDA_DOWNLOAD=Miniconda3-latest-Linux-x86_64.sh
               CONDA_DEPS='gammapy numpy astropy scipy matplotlib pytest pyyaml'

        # Python 2, no Fermi ST, all other dependencies
        - os: linux
          env: NAME=py2_st-no_dep-yes
               PYTHON_VERSION=2.7
               ST_INSTALL=''
               DOCKER_INSTALL=''
               CONDA_DOWNLOAD=Miniconda-latest-Linux-x86_64.sh
               CONDA_DEPS='gammapy numpy astropy scipy matplotlib pytest pyyaml'

        # Python 2, SLAC ST 11-05-03, all other dependencies
        - os: linux
          sudo: required
          env: NAME=py2_slac-st-11-05-03
               PYTHON_VERSION=2.7
               ST_INSTALL=''
               DOCKER_INSTALL='bash dockerinstall.sh docker/centos6-11-05-03-python'
               CONDA_DOWNLOAD=Miniconda-latest-Linux-x86_64.sh
               CONDA_DEPS='gammapy numpy astropy scipy matplotlib pytest pyyaml'
               FERMI_DIR='/home'
               SLAC_ST_BUILD=true

        # Python 2, SLAC ST 11-07-00, all other dependencies
        - os: linux
          sudo: required
          env: NAME=py2_slac-st-11-07-00
               PYTHON_VERSION=2.7
               ST_INSTALL=''
               DOCKER_INSTALL='bash dockerinstall.sh docker/centos6-11-07-00-python'
               CONDA_DOWNLOAD=Miniconda-latest-Linux-x86_64.sh
               CONDA_DEPS='gammapy numpy astropy scipy matplotlib pytest pyyaml'
               FERMI_DIR='/home'
               SLAC_ST_BUILD=true

    allow_failures:

        # Python 2, SLAC ST 11-07-00, gammapy master
        - os: linux
          sudo: required
          env: NAME=py2_slac-st-11-07-00-gammapy-master
               PYTHON_VERSION=2.7
               ST_INSTALL=''
               DOCKER_INSTALL='bash dockerinstall.sh docker/centos6-11-07-00-python'
               CONDA_DOWNLOAD=Miniconda-latest-Linux-x86_64.sh
               CONDA_DEPS='cython numpy astropy scipy matplotlib pytest pyyaml'
               FERMI_DIR='/home'
               SLAC_ST_BUILD=true
               PIP_DEPS='coverage pytest-cov coveralls git+https://github.com/gammapy/gammapy.git'
              
#        # Python 3, no Fermi ST, only the required dependencies
#        # TODO: This isn't working yet, need to handle imports for opt deps more carefully
#        - os: linux
#          env: PYTHON_VERSION=3.5
#               ST_INSTALL=''
#               CONDA_DOWNLOAD=Miniconda3-latest-Linux-x86_64.sh
#               CONDA_DEPS=''
#               CONDA2=''

#before_install:
#  - cat Dockerfile
#  - $DOCKER_SETUP
#  - ls

# Setup anaconda and install packages
install:
  # Download and install the ST binaries
  - if [[ $DOCKER_INSTALL == '' ]]; then
        $ST_INSTALL; 
        source condainstall.sh;
    else
        $DOCKER_INSTALL;
        docker exec fermipy-testing /bin/bash --login -c "cd /home/fermipy && python setup.py install";
    fi

#docker exec fermipy-testing /bin/bash -c "cd /home/fermipy;source /home/fermipy/condainstall.sh";<commit_msg>experiment with allow_failures setup<commit_after>language: python
dist: trusty
services:
  - docker

#cache:
#  directories:
#  - $HOME/ScienceTools

notifications:
  email: false

env:
    global:
      - FERMI_DIR=$HOME/ScienceTools/x86_64-unknown-linux-gnu-libc2.19-10
      - SLAC_ST_BUILD=false      
      - PIP_DEPS='coverage pytest-cov coveralls'
      - CONDA2='conda install -y -c conda-forge healpy'
      - INSTALL_CMD='python setup.py install'
      - CONDA_CHANNELS=conda-forge

matrix:
    include:

        # The main build:
        # Python 2, Fermi ST, all dependencies
        - os: linux
          env: NAME=fssc-st-10-00-05
               PYTHON_VERSION=2.7
               CONDA_DOWNLOAD=Miniconda-latest-Linux-x86_64.sh
               ST_INSTALL='bash stinstall.sh force'
               DOCKER_INSTALL=''
               CONDA_DEPS='gammapy numpy astropy scipy matplotlib pytest pyyaml'

        # The Sphinx docs build
        # Python 3, no Fermi ST, all other dependencies
        - os: linux
          env: NAME=docs
               PYTHON_VERSION=3.5
               ST_INSTALL=''
               DOCKER_INSTALL=''
               CONDA_DOWNLOAD=Miniconda3-latest-Linux-x86_64.sh
               CONDA_DEPS='gammapy numpy astropy scipy matplotlib pytest pyyaml sphinx sphinx_rtd_theme'

        # Python 3.5, no Fermi ST, all other dependencies
        - os: linux
          env: NAME=py35_st-no_dep-yes
               PYTHON_VERSION=3.5
               ST_INSTALL=''
               DOCKER_INSTALL=''
               CONDA_DOWNLOAD=Miniconda3-latest-Linux-x86_64.sh
               CONDA_DEPS='gammapy numpy astropy scipy matplotlib pytest pyyaml'

        # Python 3.6, no Fermi ST, all other dependencies
        - os: linux
          env: NAME=py36_st-no_dep-yes
               PYTHON_VERSION=3.6
               ST_INSTALL=''
               DOCKER_INSTALL=''
               CONDA_DOWNLOAD=Miniconda3-latest-Linux-x86_64.sh
               CONDA_DEPS='gammapy numpy astropy scipy matplotlib pytest pyyaml'

        # Python 2, no Fermi ST, all other dependencies
        - os: linux
          env: NAME=py2_st-no_dep-yes
               PYTHON_VERSION=2.7
               ST_INSTALL=''
               DOCKER_INSTALL=''
               CONDA_DOWNLOAD=Miniconda-latest-Linux-x86_64.sh
               CONDA_DEPS='gammapy numpy astropy scipy matplotlib pytest pyyaml'

        # Python 2, SLAC ST 11-05-03, all other dependencies
        - os: linux
          sudo: required
          env: NAME=py2_slac-st-11-05-03
               PYTHON_VERSION=2.7
               ST_INSTALL=''
               DOCKER_INSTALL='bash dockerinstall.sh docker/centos6-11-05-03-python'
               CONDA_DOWNLOAD=Miniconda-latest-Linux-x86_64.sh
               CONDA_DEPS='gammapy numpy astropy scipy matplotlib pytest pyyaml'
               FERMI_DIR='/home'
               SLAC_ST_BUILD=true

        # Python 2, SLAC ST 11-07-00, all other dependencies
        - os: linux
          sudo: required
          env: NAME=py2_slac-st-11-07-00
               PYTHON_VERSION=2.7
               ST_INSTALL=''
               DOCKER_INSTALL='bash dockerinstall.sh docker/centos6-11-07-00-python'
               CONDA_DOWNLOAD=Miniconda-latest-Linux-x86_64.sh
               CONDA_DEPS='gammapy numpy astropy scipy matplotlib pytest pyyaml'
               FERMI_DIR='/home'
               SLAC_ST_BUILD=true
               
        # Python 2, SLAC ST 11-07-00, gammapy master
        - os: linux
          sudo: required
          env: NAME=py2_slac-st-11-07-00-gammapy-master
               PYTHON_VERSION=2.7
               ST_INSTALL=''
               DOCKER_INSTALL='bash dockerinstall.sh docker/centos6-11-07-00-python'
               CONDA_DOWNLOAD=Miniconda-latest-Linux-x86_64.sh
               CONDA_DEPS='cython numpy astropy scipy matplotlib pytest pyyaml'
               FERMI_DIR='/home'
               SLAC_ST_BUILD=true
               PIP_DEPS='coverage pytest-cov coveralls git+https://github.com/gammapy/gammapy.git'

    allow_failures:
        - env: NAME=py2_slac-st-11-07-00-gammapy-master

#        # Python 3, no Fermi ST, only the required dependencies
#        # TODO: This isn't working yet, need to handle imports for opt deps more carefully
#        - os: linux
#          env: PYTHON_VERSION=3.5
#               ST_INSTALL=''
#               CONDA_DOWNLOAD=Miniconda3-latest-Linux-x86_64.sh
#               CONDA_DEPS=''
#               CONDA2=''

#before_install:
#  - cat Dockerfile
#  - $DOCKER_SETUP
#  - ls

# Setup anaconda and install packages
install:
  # Download and install the ST binaries
  - if [[ $DOCKER_INSTALL == '' ]]; then
        $ST_INSTALL; 
        source condainstall.sh;
    else
        $DOCKER_INSTALL;
        docker exec fermipy-testing /bin/bash --login -c "cd /home/fermipy && python setup.py install";
    fi

#docker exec fermipy-testing /bin/bash -c "cd /home/fermipy;source /home/fermipy/condainstall.sh";
{'fraction_non_alphanumeric': 0.08531624974577995, 'fraction_numerical': 0.03142159853569249, 'mean_word_length': 1.8400231013572048, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '283144', 'n_tokens_mistral': 3544, 'n_tokens_neox': 3205, 'n_words': 648}