[tox]
envlist =
        {py27,py36}-django{18,19,110,111},
        py36-django20,
        gettext,flake8,docs

skipsdist = True


[testenv]
changedir = testproject
commands =
        python -Wd manage.py test captcha

setenv =
        PYTHONDONTWRITEBYTECODE=1

deps =
        django18: Django==1.8.7
        django19: Django==1.9
        django110: Django==1.10
        django111: Django==1.11
        django20: Django==2.0

        py27-django{18,19,110,111}: python-memcached
        py36-django{18,19,110,111,20}: python3-memcached
        Pillow
        six
        south
        testfixtures
        django-ranged-response

[testenv:gettext]
basepython = python3
changedir = captcha/locale/
whitelist_externals =
      msgfmt

commands =
      msgfmt -c -o bg/LC_MESSAGES/django.mo bg/LC_MESSAGES/django.po
      msgfmt -c -o cs/LC_MESSAGES/django.mo cs/LC_MESSAGES/django.po
      msgfmt -c -o de/LC_MESSAGES/django.mo de/LC_MESSAGES/django.po
      msgfmt -c -o es/LC_MESSAGES/django.mo es/LC_MESSAGES/django.po
      msgfmt -c -o fr/LC_MESSAGES/django.mo fr/LC_MESSAGES/django.po
      msgfmt -c -o it/LC_MESSAGES/django.mo it/LC_MESSAGES/django.po
      msgfmt -c -o ja/LC_MESSAGES/django.mo ja/LC_MESSAGES/django.po
      msgfmt -c -o nl/LC_MESSAGES/django.mo nl/LC_MESSAGES/django.po
      msgfmt -c -o pl/LC_MESSAGES/django.mo pl/LC_MESSAGES/django.po
      msgfmt -c -o pt_BR/LC_MESSAGES/django.mo pt_BR/LC_MESSAGES/django.po
      msgfmt -c -o ru/LC_MESSAGES/django.mo ru/LC_MESSAGES/django.po
      msgfmt -c -o sk/LC_MESSAGES/django.mo sk/LC_MESSAGES/django.po
      msgfmt -c -o tr/LC_MESSAGES/django.mo tr/LC_MESSAGES/django.po
      msgfmt -c -o uk/LC_MESSAGES/django.mo uk/LC_MESSAGES/django.po
      msgfmt -c -o zh_CN/LC_MESSAGES/django.mo zh_CN/LC_MESSAGES/django.po

[testenv:flake8]
basepython = python
deps = flake8==2.4.1
commands=
    flake8 {toxinidir}/captcha

[testenv:docs]
deps =
    sphinx
    six
changedir = docs
commands=
        sphinx-build -b html . _build/html
