[tox]
envlist =
    py{35,36,37}-django20
    py{35,36,37}-django21
    py{35,36,37,38,39}-django22
    py{36,37,38,39}-django30
    py{36,37,38,39}-django31
    py{36,37,38,39}-django32
    py{38,39}-django40
    py{39}-djangomaster
    docs
    checkqa
    standardjs

[testenv]
setenv =
    PYTHONWARNINGS = all
deps =
    coverage
    django20: Django==2.0.*
    django21: Django==2.1.*
    django22: Django==2.2.*
    django30: Django==3.0.*
    django31: Django==3.1.*
    django32: Django==3.2.*
    django40: Django==4.0.*
    djangomaster: https://api.github.com/repos/django/django/tarball/master
commands =
    coverage run manage.py test {posargs:allauth}
    coverage report
    coverage html

[testenv:docs]
skip_install = True
deps =
    Sphinx
whitelist_externals = make
commands =
    make -C {toxinidir}/docs html

[testenv:checkqa]
skip_install = True
ignore_errors = True
deps =
    flake8==3.9.2
    isort==5.8.0
    black==21.6b0
commands =
    flake8 {posargs:{toxinidir}/allauth}
    isort --check-only --skip-glob '*/migrations/*' --diff {posargs:{toxinidir}/allauth}
    black --check {posargs:{toxinidir}/allauth} {posargs:{toxinidir}/setup.py}

[testenv:isort]
basepython = python3.7
skip_install = True
deps =
    isort >5
commands =
    isort --skip-glob '*/migrations/*' {posargs:{toxinidir}/allauth}

[testenv:standardjs]
skip_install = True
commands =
    /usr/bin/env bash -c "mkdir -p {toxinidir}/node_modules"
    /usr/bin/env npm install standard --no-lockfile --no-progress --non-interactive --silent
    /usr/bin/env bash -c "find {toxinidir}/allauth -name '*.js' | xargs {toxinidir}/node_modules/.bin/standard"

[coverage:run]
include = allauth*

[flake8]
exclude = migrations

[gh-actions:env]
PYTHON_VER =
    3.5: py35
    3.6: py36
    3.7: py37
    3.8: py38
    3.9: py39
DJANGO =
    master: djangomaster
    2.0: django20
    2.1: django21
    2.2: django22
    3.0: django30
    3.1: django31
    3.2: django32
    4.0: django40
