[tox]
envlist =
    py{36,37,38,39}{,-alldeps,-oldestdeps}{,-cov}
    codestyle
    build_docs
isolated_build = true


[testenv]
description =
    run tests

deps =
    oldestdeps: astropy==1.0.0
    oldestdeps: extinction==0.2.2
    oldestdeps: numpy==1.18
    oldestdeps: scipy==0.9.0

# The following indicates which extras_require from setup.cfg will be installed
extras =
    test
    alldeps: all
    cov: test_coverage


commands =
    pip freeze
    !cov: pytest
    cov: pytest --cov==sncosmo
    cov: coveralls --rcfile='sncosmo/tests/coveragerc'


[testenv:codestyle]
changedir = {toxinidir}
skip_install = true
description = check code style
deps = pycodestyle
commands =
    python setup.py egg_info
    ./checkstyle

[testenv:build_docs]
changedir = {toxinidir}
description = Building the narrative and API docs
extras = docs
deps =
    sphinx
    sphinx-gallery
    pygments
    matplotlib==3.2
    ; needed to use this version of matplotlib to avoid Exception
    pillow
    sphinx_rtd_theme
    numpydoc
    Cython
    iminuit
allowlist_externals = 
    make
commands =
    pip freeze
    python setup.py install
    make -C docs/ html

[tox]
envlist =
    py{36,37,38,39}-test{,-alldeps,-oldestdeps}{,-cov}
    codestyle
    build_docs
isolated_build = true


[testenv]
description =
    run tests

deps =
    oldestdeps: astropy==1.0.0
    oldestdeps: extinction==0.2.2
    oldestdeps: numpy==1.18
    oldestdeps: scipy==0.9.0

# The following indicates which extras_require from setup.cfg will be installed
extras =
    test: test
    alldeps: all
    cov: test_coverage


commands =
    pip freeze
    !cov: pytest
    cov: pytest --cov==sncosmo
    cov: coveralls --rcfile='sncosmo/tests/coveragerc'


[testenv:codestyle]
changedir = {toxinidir}
skip_install = true
description = check code style
deps = pycodestyle
commands =
    python setup.py egg_info
    ./checkstyle

[testenv:build_docs]
changedir = {toxinidir}
description = Building the narrative and API docs
extras = docs
deps =
    sphinx
    sphinx-gallery
    pygments
    matplotlib==3.2
    ; needed to use this version of matplotlib to avoid Exception
    pillow
    sphinx_rtd_theme
    numpydoc
    Cython
    iminuit
allowlist_externals = 
    make
commands =
    pip freeze
    python setup.py install
    make -C docs/ html

Use the same schema as numpy for test names.
Use the same schema as numpy for test names.
