# 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 = black-format,flake8,pylint,twine,py27,py36 skip_missing_interpreters = False [flake8] max-line-length = 120 exclude = build/ .git __pycache__ .tox tests/data/ venv/ ./src/sagemaker_containers/record_pb2.py max-complexity = 15 ignore = E203, # whitespace before ':': Black disagrees with and explicitly violates this. W503 # Ignore line break before binary operator, since Black violates this. builtins = FileNotFoundError [testenv] passenv = AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN AWS_CONTAINER_CREDENTIALS_RELATIVE_URI AWS_DEFAULT_REGION # {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 commands = coverage run --rcfile .coveragerc_{envname} --source sagemaker_containers -m py.test {posargs} {env:IGNORE_COVERAGE:} coverage report --rcfile .coveragerc_{envname} {env:IGNORE_COVERAGE:} coverage html --rcfile .coveragerc_{envname} deps = pytest==4.4.1 pytest-cov pytest-xdist mock awslogs sagemaker[local] numpy flask gunicorn gevent paramiko==2.4.2 psutil==5.6.7 [testenv:twine] basepython = python3 # twine check was added starting in 1.12.0 # https://github.com/pypa/twine/blob/master/docs/changelog.rst deps = twine>=1.12.0 # https://packaging.python.org/guides/making-a-pypi-friendly-readme/#validating-restructuredtext-markup commands = python setup.py sdist twine check dist/*.tar.gz [testenv:flake8] basepython = python3 deps = flake8 pep8-naming flake8-import-order commands = flake8 [testenv:black-format] # Used during development (before committing) to format .py files. basepython = python3 deps = black==19.3b0 commands = black -l 100 ./ [testenv:black-check] # Used by automated build steps to check that all files are properly formatted. basepython = python3 deps = black==19.3b0 commands = black -l 100 --check ./ [testenv:pylint] basepython = python3 skipdist = true skip_install = true deps = pylint==2.3.1 commands = python -m pylint --rcfile=.pylintrc -j 0 src/sagemaker_containers