# Tox (http://tox.testrun.org/) is a tool for running tests
# in multiple virtualenvs. This configuration file will run the
# test suite on all supported python versions. To use it, "pip install tox"
# and then run "tox" from this directory.

[tox]
envlist = py27, py34, py35, py36, docs, coverage-report
skip_missing_interpreters = true

[testenv]
commands = py.test {posargs:-sv}
deps =
    pytest
    coverage

# Run coverage for py27, py35 targets:

[testenv:py27]
commands = coverage run --parallel -m pytest {posargs}

[testenv:py35]
commands = coverage run --parallel -m pytest {posargs}


[testenv:coverage-report]
skip_install = true
commands =
    coverage combine
    coverage report


[testenv:docs]
passenv = HOME
basepython = python2
whitelist_externals =
    pandoc
deps=
    sphinx
commands=
    pip install -r documentation/requirements.txt
    pip install -e .
    sphinx-build -W -b html -d {envtmpdir}/doctrees documentation/source  {envtmpdir}/html

# Tox (http://tox.testrun.org/) is a tool for running tests
# in multiple virtualenvs. This configuration file will run the
# test suite on all supported python versions. To use it, "pip install tox"
# and then run "tox" from this directory.

[tox]
envlist = py27, py34, py35, py36, docs, coverage-report
skip_missing_interpreters = true

[testenv]
commands = py.test {posargs:-sv}
deps =
    pytest
    coverage
    numpy

# Run coverage for py27, py35 targets:

[testenv:py27]
commands = coverage run --parallel -m pytest {posargs}

[testenv:py35]
commands = coverage run --parallel -m pytest {posargs}


[testenv:coverage-report]
skip_install = true
commands =
    coverage combine
    coverage report


[testenv:docs]
passenv = HOME
basepython = python2
whitelist_externals =
    pandoc
deps=
    astropy
    numpy
    sphinx
commands=
    pip install -r documentation/requirements.txt
    pip install -e .
    sphinx-build -W -b html -d {envtmpdir}/doctrees documentation/source  {envtmpdir}/html

Fix Travis-CI builds. (Numpy version mismatch).
TST: Fix Travis-CI builds. (Numpy version mismatch).

Pre-Install numpy,astropy for tox tests, to avoid weird Travis issue.

Was seeing 'Numpy version build mismatch' errors, cf
https://github.com/astropy/astropy/issues/6133

Pre-installing numpy mostly works, but it seems we need to
pre-install astropy as well before Sphinx is happy.

DO YOU DO VOODOO LIKE I DO?
https://en.wikipedia.org/wiki/Voodoo_programming
