cache: pip
dist: xenial
language: python
python:
  - "2.7"
  - "3.7"

env:
  - SPHINX_SPEC='~=1.7.0'
  - SPHINX_SPEC='~=1.8.0'
  - SPHINX_SPEC='~=2.0.0'
  - SPHINX_SPEC='~=2.1.0'
  # latest release
  - SPHINX_SPEC=''

matrix:
  # exclude non Python2 compatible Sphinx versions
  exclude:
  - python:
      "2.7"
    env:
      SPHINX_SPEC='~=2.0.0'
  - python:
      "2.7"
    env:
      SPHINX_SPEC='~=2.1.0'

install:
  - pip install coveralls sphinx_rtd_theme "sphinx${SPHINX_SPEC:-}"
  - python setup.py install

script:
  - coverage run --source=hieroglyph setup.py test
  - cd docs; READTHEDOCS=True SPHINXOPTS="-NqW" SPHINXBUILD="sphinx-build" make -e clean html slides; cd ..

after_success:
  - coveralls

cache: pip
dist: xenial
language: python
python:
  - "2.7"
  - "3.7"

env:
  - SPHINX_SPEC='sphinx~=1.7.0'
  - SPHINX_SPEC='sphinx~=1.8.0'
  - SPHINX_SPEC='sphinx~=2.0.0'
  - SPHINX_SPEC='sphinx~=2.1.0'
  # latest release
  - SPHINX_SPEC='sphinx'
  # master branch (in development)
  - SPHINX_SPEC='git+https://github.com/sphinx-doc/sphinx.git#egg=Sphinx-dev'

matrix:
  # exclude non Python2 compatible Sphinx versions
  exclude:
  - python: "2.7"
    env: SPHINX_SPEC='sphinx~=2.0.0'
  - python: "2.7"
    env: SPHINX_SPEC='sphinx~=2.1.0'
  - python: "2.7"
    env: SPHINX_SPEC='sphinx'
  - python: "2.7"
    env: SPHINX_SPEC='git+https://github.com/sphinx-doc/sphinx.git#egg=Sphinx-dev'

  allow_failures:
  - env: SPHINX_SPEC='git+https://github.com/sphinx-doc/sphinx.git#egg=Sphinx-dev'

install:
  - pip install coveralls sphinx_rtd_theme "${SPHINX_SPEC}"
  - python setup.py install

script:
  - coverage run --source=hieroglyph setup.py test
  - cd docs; READTHEDOCS=True SPHINXOPTS="-NqW" SPHINXBUILD="sphinx-build" make -e clean html slides; cd ..

after_success:
  - coveralls

Build against Sphinx master branch
Build against Sphinx master branch
