# 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,docstyle,doc8,twine,py36,py37,py38 skip_missing_interpreters = False [flake8] max-line-length = 120 exclude = build/ .git .github/ __pycache__ examples/ .tox tests/data/ venv/ docs/ .DS_Store max-complexity = 10 ignore = C901, 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 require-code = True [doc8] ignore-path=.tox,src/smjsindustry.egg-info,tests/data,docs ignore=D001 [pytest] markers = canary_quick cron local_mode timeout: mark a test as a timeout. [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 = pytest --cov=smjsindustry --cov-append {posargs} {env:IGNORE_COVERAGE:} coverage report -i --fail-under=86 deps = .[test] depends = {py36,py37,py38}: clean [testenv:flake8] skipdist = true skip_install = true deps = flake8 flake8-future-import commands = flake8 [testenv:pylint] skipdist = true skip_install = true deps = pylint astroid==2.4.2 commands = python -m pylint --rcfile=.pylintrc -j 0 src/smjsindustry [testenv:spelling] skipdist = true skip_install = true deps = pyenchant pylint commands = python -m pylint --rcfile=.pylintrc --disable all --enable spelling --spelling-dict en_US src/smjsindustry/{posargs} [testenv:twine] # 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:doc8] deps = doc8 Pygments commands = doc8 [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 ./ [testenv:clean] deps = coverage skip_install = true commands = coverage erase [testenv:typing] deps = mypy commands = mypy src/smjsindustry [testenv:docstyle] deps = pydocstyle commands = pydocstyle src/smjsindustry [testenv:collect-tests] # this needs to succeed for tests to display in some IDEs deps = .[test] commands = pytest --collect-only