# 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.
[pytest]
python_files = test_*.py
django_find_project = false

[tox]
skipsdist = True
envlist = py38-django{200,210,220,300,310}

[travis]
python =
  3.8: py38

[travis:env]
DJANGO =
  2.0: django200
  2.1: django210
  2.2: django220
  3.0: django300
  3.1: django310
[testenv]
changedir = {toxinidir}/django_comments_xtd
commands = py.test -rw --cov-config .coveragerc --cov django_comments_xtd
deps =
    six
    docutils
    Markdown
    django-markup
    pytest
    pytest-cov
    pytest-django
    selenium
    py38-django200: django>=2.0,<2.1
    py38-django210: django>=2.1,<2.2
    py38-django220: django>=2.2,<2.3
    py38-django300: django>=3.0,<3.1
    py38-django310: django>=3.1,<3.2
    py38-django{200,210,220,300,310}: djangorestframework>=3.9
    py38-django{200,210,220,300,310}: django-contrib-comments
setenv =
    PYTHONPATH = {toxinidir}:{toxinidir}
    DJANGO_SETTINGS_MODULE=django_comments_xtd.tests.settings

[testenv:pep8]
show-source = True
commands = {envbindir}/flake8 --max-line-length=80 --exclude=.tox,docs,django_comments_xtd/tests,django_comments_xtd/__init__.py,django_comments_xtd/migrations django_comments_xtd
# Flake8 only needed when linting.
# Do not care about other dependencies, it's just for linting.
deps = flake8
changedir = {toxinidir}

[testenv:js]
commands =
    npm install --prefix {toxinidir}
