# 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.

[tox]
envlist = py27,py35,flake8
skip_missing_interpreters = False

[flake8]
max-line-length = 120
exclude =
    build/
    .git
    __pycache__
    .tox
    tests/resources/
    lib/
max-complexity = 10
ignore =
    FI10,
    FI11,
    FI12,
    FI13,
    FI14,
    FI15,
    FI16,
    FI17,
    FI50,
    FI51,
    FI52,
    FI53,
    FI54,
    FI55,
    FI56,
    FI57
require-code = True

[testenv]
# {posargs} can be passed in by additional arguments specified when invoking tox.
# Can be used to specify which tests to run, e.g.: tox -- -s
passenv =
    AWS_ACCESS_KEY_ID
    AWS_SECRET_ACCESS_KEY
    AWS_SESSION_TOKEN
    AWS_CONTAINER_CREDENTIALS_RELATIVE_URI
    AWS_DEFAULT_REGION
commands =
    pip install -U sagemaker-containers
    coverage run --source sagemaker_chainer_container -m py.test test/unit {posargs}
    {env:IGNORE_COVERAGE:} coverage report
deps =
    coverage
    pytest
    pytest-cov
    pytest-xdist
    mock
    requests == 2.20.0
    sagemaker

[testenv:flake8]
basepython = python
deps =
    flake8
    flake8-future-import
commands = flake8