incorporeal-cms/tox.ini

85 lines
2.0 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
# install everything via requirements-dev.txt, so that developer environment
# is the same as the tox environment (for ease of use/no weird gotchas in
# local dev results vs. tox results) and also to avoid ticky-tacky maintenance
# of "oh this particular env has weird results unless I install foo" --- just
# shotgun blast install everything everywhere
deps =
-rrequirements/requirements-dev.txt
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
commands =
pytest --cov={envsitepackagesdir}/incorporealcms/ \
--cov-report=term-missing --cov-branch --cov-fail-under=95
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
commands =
bandit {envsitepackagesdir}/incorporealcms/ -r
[testenv:lint]
# run style checks
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
# redundant with pytest --cov above, but this tricks the coverage.xml report into
# using the full path, otherwise files with the same name in different paths
# get clobbered. maybe appends would fix this, IDK
include =
.tox/**/incorporealcms/
omit =
**/_version.py
2020-06-16 22:59:23 -05:00
[flake8]
enable-extensions = G
exclude =
.tox/
versioneer.py
_version.py
instance/
extend-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