[tox]
envlist = lint,format,licenses,bandit,{py27,py34,py35,py36,py37}-pika{0x,1}-{unittest,integration}

[testenv]
passenv = CI TRAVIS TRAVIS_*
deps =
    pika0x: pika<1.0.0b1
    pika1: git+https://github.com/pika/pika.git
    -rdev-requirements.txt
sitepackages = False
commands =
    coverage erase
    unittest: coverage run -m pytest -vv fedora_messaging/tests/unit {posargs}
    integration: coverage run -m pytest -vv fedora_messaging/tests/integration {posargs}
    coverage report -m
    coverage xml
    coverage html

[testenv:docs]
changedir = docs
whitelist_externals =
    mkdir
    rm
commands=
    mkdir -p _static
    rm -rf _build
    sphinx-build -W -b html -d {envtmpdir}/doctrees .  _build/html
    sphinx-build -W -b man -d {envtmpdir}/doctrees .  _build/man

[testenv:lint]
deps =
    flake8 > 3.0
commands =
    python -m flake8 {posargs}

[testenv:format]
deps =
    black
commands =
    python -m black --check {posargs:.}

[testenv:licenses]
deps =
    liccheck
commands =
    liccheck -s .license_strategy.ini

[testenv:bandit]
deps = bandit
commands =
    bandit -r fedora_messaging/ -x fedora_messaging/tests/ -ll


[flake8]
show-source = True
max-line-length = 100
ignore = E203,W503
exclude = .git,.tox,dist,*egg

[pytest]
testpaths = fedora_messaging/tests/unit/
