# 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] skipsdist = True skip_missing_interpreters = False envlist = black-format,jshint,flake8,pylint,py36,py37 [flake8] max-line-length = 100 exclude = build/ .github/ .pytest_cache/ .git .tox tests/resources/ docker/build_artifacts/sagemaker/tensorflow/ docker/build_artifacts/sagemaker/tensorflow-2.1/ docker/build_artifacts/sagemaker/tensorflow-2.2/ max-complexity = 10 ignore = E203, # whitespace before ':': Black disagrees with and explicitly violates this. FI10, FI12, FI13, FI14, FI15, FI16, FI17, FI18, # __future__ import "annotations" missing -> check only Python 3.7 compatible FI50, FI51, FI52, FI53, FI54, FI55, FI56, FI57, W503 # Ignore line break before binary operator, since Black violates this. 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 basepython = python3 passenv = AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN AWS_CONTAINER_CREDENTIALS_RELATIVE_URI AWS_DEFAULT_REGION commands = python -m pytest {posargs} deps = pytest pytest-xdist boto3 requests [testenv:flake8] deps = flake8 commands = flake8 docker/build_artifacts/ [testenv:pylint] deps = pylint commands = python -m pylint --rcfile=.pylintrc docker/build_artifacts/ [testenv:jshint] whitelist_externals = jshint commands = jshint docker/build_artifacts/ [testenv:black-format] # Used during development (before committing) to format .py files. setenv = LC_ALL=C.UTF-8 LANG=C.UTF-8 deps = black commands = black -l 100 ./ [testenv:black-check] # Used by automated build steps to check that all files are properly formatted. setenv = LC_ALL=C.UTF-8 LANG=C.UTF-8 deps = black commands = black -l 100 --check ./ [pytest] markers = skip_gpu: skip test if running on gpu instance