dependencies:
  override:
    - sudo apt-get install libatlas-dev libatlas-base-dev liblapack-dev gfortran libgmp-dev libmpfr-dev libfreetype6-dev libpng-dev zlib1g-dev texlive-fonts-recommended
    - pip install -q --install-option="--no-cython-compile" Cython==0.23.4
    - pip install -q numpy
    - pip install -q nose mpmath argparse Pillow codecov matplotlib Sphinx==1.5.5
    - git submodule init
    - git submodule update

test:
  override:
    - python -u runtests.py -g --shell -- -c 'make -C doc PYTHON=python html-scipyorg'

general:
  artifacts:
    - "doc/build/html-scipyorg"

# Upload build output to scipy/devdocs repository, using SSH deploy keys.
# The keys are only available for builds on master branch.
# https://developer.github.com/guides/managing-deploy-keys/
# https://circleci.com/docs/1.0/configuration/#ssh-keys
deployment:
  master:
    branch: master
    owner: scipy
    commands:
      - >
        set -e;
        git clone git@github.com:scipy/devdocs.git devdocs;
        cd devdocs;
        (git checkout --orphan tmp && git branch -D gh-pages || true);
        git checkout --orphan gh-pages;
        git reset --hard;
        cp -R ../doc/build/html-scipyorg/. .;
        touch .nojekyll;
        git config --global user.email "scipy-circleci-bot@nomail";
        git config --global user.name "scipy-circleci-bot";
        git config --global push.default simple;
        git add . > /dev/null;
        git commit -m "Docs build of $CIRCLE_SHA1";
        git push --set-upstream origin gh-pages --force
