<commit_before>machine:
  environment:
    # We need to set this variable to let Anaconda take precedence
    PATH: "/home/ubuntu/miniconda/envs/circleenv/bin:/home/ubuntu/miniconda/bin:$PATH"
    DISPLAY: ":99.0"

dependencies:
  cache_directories:
    - "~/miniconda"
    - "~/.mne"
    - "~/mne_data/MNE-sample-data"
    - "~/mne_data/MNE-testing-data"
    - "~/mne_data/MNE-misc-data"
    - "~/mne_data/MNE-spm-face"
    - "~/mne_data/MNE-somato-data"
    - "~/mne_data/MNE-brainstorm-data"
    - "~/mne_data/MEGSIM"
    - "~/mne_data/MNE-eegbci-data"
    - "~/mne-tools.github.io"
  # Various dependencies
  pre:
    # Get a running Python
    - cd ~;
    # Disable pyenv (no cleaner way provided by CircleCI as it prepends pyenv version to PATH)
    - rm -rf ~/.pyenv;
    - rm -rf ~/virtualenvs;
    # Get Anaconda and conda-based requirements
    - >
      if [ ! -d "/home/ubuntu/miniconda" ]; then
        echo "Setting up conda";
        wget -q http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O ~/miniconda.sh;
        chmod +x ~/miniconda.sh;
        ~/miniconda.sh -b -p /home/ubuntu/miniconda;
        conda update --yes --quiet conda;
        conda create -n circleenv --yes pip python=2.7 pip;
        sed -i "s/ENABLE_USER_SITE = .*/ENABLE_USER_SITE = False/g" /home/ubuntu/miniconda/envs/circleenv/lib/python2.7/site.py;
      else
        echo "Conda already set up.";
      fi
    - conda install -n circleenv --yes numpy scipy scikit-learn mayavi matplotlib sphinx pillow six IPython pandas;
    - ls -al /home/ubuntu/miniconda;
    - ls -al /home/ubuntu/miniconda/bin;
    - echo $PATH;
    - echo $CIRCLE_BRANCH
    - which python;
    - which pip;
    - pip install --upgrade pyface;
    - git clone https://github.com/sphinx-gallery/sphinx-gallery.git;
    - cd sphinx-gallery && pip install -r requirements.txt && python setup.py develop;
    - pip install sphinx_bootstrap_theme git+git://github.com/nipy/PySurfer.git nilearn neo numpydoc;

  override:
    # Figure out if we should run a full, pattern, or noplot version
    - cd /home/ubuntu/mne-python && python setup.py develop;
    - git remote add upstream git://github.com/mne-tools/mne-python.git;
    - git fetch upstream;
    - git branch -a;
    - mkdir -p ~/mne_data;
    - PATTERN="";
      if [ "$CIRCLE_BRANCH" == "master" ] || [[ `git log -1 --pretty=%B` == *"[circle full]"* ]]; then
        echo html_dev > build.txt;
      elif [ "$CIRCLE_BRANCH" == "maint/0.13" ]; then
        echo html_stable > build.txt;
      else
        FNAMES=$(git diff --name-only $CIRCLE_BRANCH $(git merge-base $CIRCLE_BRANCH upstream/master));
        echo FNAMES="$FNAMES";
        for FNAME in $FNAMES; do
          if [[ `expr match $FNAME "\(tutorials\|examples\)/.*plot_.*\.py"` ]] ; then
            echo "Checking example $FNAME ...";
            PATTERN=`basename $FNAME`"\\|"$PATTERN;
            if [[ $(cat $FNAME | grep -x ".*datasets.*sample.*" | wc -l) -gt 0 ]]; then
              python -c "import mne; print(mne.datasets.sample.data_path(update_path=True))";
            fi;
            if [[ $(cat $FNAME | grep -x ".*datasets.*somato.*" | wc -l) -gt 0 ]]; then
              python -c "import mne; print(mne.datasets.somato.data_path(update_path=True))";
            fi;
            if [[ $(cat $FNAME | grep -x ".*datasets.*eegbci.*" | wc -l) -gt 0 ]]; then
              python -c "import mne; print(mne.datasets.eegbci.load_data(1, [6, 10, 14], update_path=True))";
            fi;
            if [[ $(cat $FNAME | grep -x ".*brainstorm.*bst_auditory.*" | wc -l) -gt 0 ]]; then
              python -c "import mne; print(mne.datasets.brainstorm.bst_auditory.data_path(update_path=True))" --accept-brainstorm-license;<commit_msg>FIX: Fix circle [ci skip]<commit_after>machine:
  environment:
    # We need to set this variable to let Anaconda take precedence
    PATH: "/home/ubuntu/miniconda/envs/circleenv/bin:/home/ubuntu/miniconda/bin:$PATH"
    DISPLAY: ":99.0"

dependencies:
  cache_directories:
    - "~/miniconda"
    - "~/.mne"
    - "~/mne_data/MNE-sample-data"
    - "~/mne_data/MNE-testing-data"
    - "~/mne_data/MNE-misc-data"
    - "~/mne_data/MNE-spm-face"
    - "~/mne_data/MNE-somato-data"
    - "~/mne_data/MNE-brainstorm-data"
    - "~/mne_data/MEGSIM"
    - "~/mne_data/MNE-eegbci-data"
    - "~/mne-tools.github.io"
  # Various dependencies
  pre:
    # Get a running Python
    - cd ~;
    # Disable pyenv (no cleaner way provided by CircleCI as it prepends pyenv version to PATH)
    - rm -rf ~/.pyenv;
    - rm -rf ~/virtualenvs;
    # Get Anaconda and conda-based requirements
    - >
      if [ ! -d "/home/ubuntu/miniconda" ]; then
        echo "Setting up conda";
        wget -q http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O ~/miniconda.sh;
        chmod +x ~/miniconda.sh;
        ~/miniconda.sh -b -p /home/ubuntu/miniconda;
        conda update --yes --quiet conda;
        conda create -n circleenv --yes pip python=2.7 pip;
        sed -i "s/ENABLE_USER_SITE = .*/ENABLE_USER_SITE = False/g" /home/ubuntu/miniconda/envs/circleenv/lib/python2.7/site.py;
      else
        echo "Conda already set up.";
      fi
    - conda install -n circleenv --yes numpy scipy scikit-learn mayavi matplotlib sphinx pillow six IPython pandas;
    - ls -al /home/ubuntu/miniconda;
    - ls -al /home/ubuntu/miniconda/bin;
    - echo $PATH;
    - echo $CIRCLE_BRANCH
    - which python;
    - which pip;
    - pip install --upgrade pyface;
    - git clone https://github.com/sphinx-gallery/sphinx-gallery.git;
    - cd sphinx-gallery && pip install -r requirements.txt && python setup.py develop;
    - pip install sphinx_bootstrap_theme git+git://github.com/nipy/PySurfer.git nilearn neo numpydoc;

  override:
    # Figure out if we should run a full, pattern, or noplot version
    - cd /home/ubuntu/mne-python && python setup.py develop;
    - if ! git remote -v | grep upstream ; then git remote add upstream git://github.com/mne-tools/mne-python.git; fi;
    - git fetch upstream;
    - git branch -a;
    - mkdir -p ~/mne_data;
    - PATTERN="";
      if [ "$CIRCLE_BRANCH" == "master" ] || [[ `git log -1 --pretty=%B` == *"[circle full]"* ]]; then
        echo html_dev > build.txt;
      elif [ "$CIRCLE_BRANCH" == "maint/0.13" ]; then
        echo html_stable > build.txt;
      else
        FNAMES=$(git diff --name-only $CIRCLE_BRANCH $(git merge-base $CIRCLE_BRANCH upstream/master));
        echo FNAMES="$FNAMES";
        for FNAME in $FNAMES; do
          if [[ `expr match $FNAME "\(tutorials\|examples\)/.*plot_.*\.py"` ]] ; then
            echo "Checking example $FNAME ...";
            PATTERN=`basename $FNAME`"\\|"$PATTERN;
            if [[ $(cat $FNAME | grep -x ".*datasets.*sample.*" | wc -l) -gt 0 ]]; then
              python -c "import mne; print(mne.datasets.sample.data_path(update_path=True))";
            fi;
            if [[ $(cat $FNAME | grep -x ".*datasets.*somato.*" | wc -l) -gt 0 ]]; then
              python -c "import mne; print(mne.datasets.somato.data_path(update_path=True))";
            fi;
            if [[ $(cat $FNAME | grep -x ".*datasets.*eegbci.*" | wc -l) -gt 0 ]]; then
              python -c "import mne; print(mne.datasets.eegbci.load_data(1, [6, 10, 14], update_path=True))";
            fi;
            if [[ $(cat $FNAME | grep -x ".*brainstorm.*bst_auditory.*" | wc -l) -gt 0 ]]; then
              python -c "import mne; print(mne.datasets.brainstorm.bst_auditory.data_path(update_path=True))" --accept-brainstorm-license;
{'fraction_non_alphanumeric': 0.15514958962139264, 'fraction_numerical': 0.006619009796134498, 'mean_word_length': 2.312143796580447, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 2, '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': '7500704', 'n_tokens_mistral': 2904, 'n_tokens_neox': 2722, 'n_words': 641}