incorporeal-cms/tox.ini

95 lines
1.8 KiB
INI
Raw Normal View History

2020-06-16 22:59:23 -05:00
# tox (https://tox.readthedocs.io/) 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 = py37,security,lint
2020-06-16 22:59:23 -05:00
[testenv]
# build a wheel and test it
wheel = true
wheel_build_env = build
# whitelist commands we need
whitelist_externals = ln
# for environment sanity, things that are in written code being security
# checked, linted, etc., but are not part of the installed package, should
# go here, so that all envs may benefit from them
[base]
deps =
pytest
2020-06-16 22:59:23 -05:00
[testenv:build]
# require setuptools when building
deps = setuptools
[testenv:py37]
# run pytest with coverage
2020-06-16 22:59:23 -05:00
deps =
pytest-cov
{[base]deps}
2020-06-16 22:59:23 -05:00
commands =
pytest --cov={envsitepackagesdir}/incorporealcms/ \
--cov-report=term-missing --cov-branch --cov-fail-under=90
ln -sf {distdir} .
2020-06-16 22:59:23 -05:00
[testenv:security]
# run security checks
#
# again it seems the most valuable here to run against the packaged code
deps =
bandit
{[base]deps}
commands =
bandit {envsitepackagesdir}/incorporealcms/ -r
[testenv:lint]
# run style checks
skip_install = true
deps =
2020-06-20 10:48:46 -05:00
dlint
flake8
flake8-blind-except
flake8-builtins
flake8-docstrings
flake8-executable
2020-06-20 10:48:46 -05:00
flake8-fixme
2020-06-19 20:23:23 -05:00
flake8-isort
flake8-logging-format
{[base]deps}
commands =
flake8
- flake8 --disable-noqa --ignore= --select=E,W,F,C,D,A,G,B,I,T,DUO
[coverage:paths]
source =
./
.tox/**/site-packages/
[coverage:run]
branch = True
omit =
**/_version.py
2020-06-16 22:59:23 -05:00
[flake8]
enable-extensions = G
exclude =
.tox/
versioneer.py
_version.py
instance/
ignore = T101
max-complexity = 10
2020-06-20 10:48:46 -05:00
max-line-length = 120
2020-06-16 22:59:23 -05:00
2020-06-19 20:23:23 -05:00
[isort]
line_length = 120
2020-06-16 22:59:23 -05:00
[pytest]
python_files =
*_tests.py
tests.py
test_*.py