[tox]
minversion = 1.6
skipsdist = True
envlist = py35,py27,pep8

[testenv]
usedevelop = True
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
setenv =
    VIRTUAL_ENV={envdir}
    DJANGO_SETTINGS_MODULE=solumdashboard.tests.settings
deps =
    -r{toxinidir}/requirements.txt
    -r{toxinidir}/test-requirements.txt

commands = 
	stestr run --concurrency 1 {posargs}
	stestr slowest

[testenv:cover]
basepython = python3
setenv =
    {[testenv]setenv}
    PYTHON=coverage run --source solumdashboard --parallel-mode
commands =
    stestr run --concurrency 1 {posargs}
    coverage combine
    coverage html -d cover
    coverage xml -o cover/coverage.xml

[testenv:pep8]
basepython = python3
commands = flake8

[testenv:venv]
basepython = python3
commands = {posargs}

[flake8]
show-source = true
builtins = _
exclude=.git,.tox,dist,doc,*lib/python*,*egg,tools,horizon,node_modules

[testenv:docs]
basepython = python3
commands = python setup.py build_sphinx

[testenv:lower-constraints]
basepython = python3
deps =
  -c{toxinidir}/lower-constraints.txt
  -r{toxinidir}/test-requirements.txt
  -r{toxinidir}/requirements.txt

[testenv:py35dj20]
basepython = python3.5
commands =
  pip install django>=2.0,<2.1
  {[testenv]commands}
