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]
|
2020-06-17 20:18:43 -05:00
|
|
|
envlist = py37,lint
|
2020-06-16 22:59:23 -05:00
|
|
|
|
|
|
|
[testenv]
|
|
|
|
# build a wheel and test it
|
|
|
|
wheel = true
|
|
|
|
wheel_build_env = build
|
|
|
|
|
|
|
|
deps =
|
|
|
|
flake8
|
2020-06-17 20:18:43 -05:00
|
|
|
flake8-docstrings
|
2020-06-16 22:59:23 -05:00
|
|
|
pytest
|
|
|
|
pytest-cov
|
|
|
|
commands =
|
|
|
|
flake8
|
2020-06-17 16:34:50 -05:00
|
|
|
pytest --cov={envsitepackagesdir}/incorporealcms/
|
2020-06-16 22:59:23 -05:00
|
|
|
|
|
|
|
# whitelist commands we need
|
|
|
|
whitelist_externals = ln
|
|
|
|
|
|
|
|
[testenv:build]
|
|
|
|
# require setuptools when building
|
|
|
|
deps = setuptools
|
|
|
|
|
2020-06-17 20:18:43 -05:00
|
|
|
[testenv:py37]
|
|
|
|
# run pytest and coverage
|
2020-06-16 22:59:23 -05:00
|
|
|
deps =
|
2020-06-17 20:18:43 -05:00
|
|
|
coverage
|
|
|
|
pytest
|
|
|
|
pytest-cov
|
2020-06-16 22:59:23 -05:00
|
|
|
commands =
|
2020-06-17 20:18:43 -05:00
|
|
|
pytest --cov={envsitepackagesdir}/incorporealcms/ --cov-report=
|
|
|
|
coverage report -m --fail-under=80
|
2020-06-16 22:59:23 -05:00
|
|
|
ln -sf {distdir} dist
|
|
|
|
|
2020-06-17 20:18:43 -05:00
|
|
|
[testenv:lint]
|
|
|
|
# run style checks
|
|
|
|
skip_install = true
|
|
|
|
deps =
|
|
|
|
flake8
|
|
|
|
flake8-docstrings
|
|
|
|
commands =
|
|
|
|
flake8
|
|
|
|
- flake8 --disable-noqa --select=E,W,F,C,D
|
|
|
|
|
2020-06-16 22:59:23 -05:00
|
|
|
[flake8]
|
|
|
|
max-line-length = 120
|
2020-06-17 20:18:43 -05:00
|
|
|
exclude =
|
|
|
|
.tox/
|
|
|
|
versioneer.py
|
|
|
|
_version.py
|
|
|
|
instance/
|
|
|
|
max-complexity = 10
|
2020-06-16 22:59:23 -05:00
|
|
|
|
|
|
|
[pytest]
|
|
|
|
python_files = tests.py test_*.py
|
|
|
|
|
|
|
|
[coverage:run]
|
|
|
|
branch = True
|
|
|
|
omit =
|
2020-06-17 16:34:50 -05:00
|
|
|
**/_version.py
|
|
|
|
|
|
|
|
[coverage:paths]
|
|
|
|
source =
|
|
|
|
./
|
|
|
|
.tox/**/site-packages/
|