eregs/regulations-core

View on GitHub
tox.ini

Summary

Maintainability
Test Coverage
[tox]
envlist = clean,py{27,34,35,36}-django{18,19,110,111}-{elastic,haystack},py{27,34,35,36}-django{110,111}-pgsql,lint,docs

[testenv]
deps =
  django18: django~=1.8.0
  django19: django~=1.9.0
  django110: django~=1.10.0
  django111: django~=1.11.0

  # Test requirements
  coverage~=4.0
  mock~=1.3
  model_mommy~=1.3
  pytest~=3.0
  pytest_cov~=2.4
  pytest_django~=3.1
extras =
  elastic: backend-elastic
  haystack: backend-haystack
  pgsql: backend-pgsql
commands =
  pytest --cov --cov-append regcore regcore_write regcore_read
  pgsql: pytest --cov --cov-append regcore regcore_write regcore_read regcore_pgsql
setenv =
  elastic: DJANGO_SETTINGS_MODULE = regcore.settings.elastic
  pgsql: DJANGO_SETTINGS_MODULE = regcore.settings.pgsql

[testenv:clean]
deps:
  coverage~=4.0
commands = coverage erase
skip_install = True
skipsdist = True

[testenv:lint]
deps =
  # Dependencies are pinned so that linting is consistent
  bandit==1.4.0
  flake8==2.5.4
commands =
  flake8 regcore regcore_pgsql regcore_read regcore_write manage.py setup.py
  bandit -r --ini tox.ini regcore regcore_pgsql regcore_read regcore_write manage.py setup.py

[testenv:docs]
deps = sphinx
commands =
  # Tox won't do wildcard expansion, so run in a shell
  sh -c "rm docs/regcore*.rst"
  sphinx-apidoc -F -o docs regcore
  sphinx-apidoc -F -o docs regcore_pgsql
  sphinx-apidoc -F -o docs regcore_read
  sphinx-apidoc -F -o docs regcore_write
  sphinx-build -b dirhtml -d docs/_build/doctrees/ docs/ docs/_build/dirhtml/
whitelist_externals = sh


[bandit]
exclude = regcore/tests,regcore_pgsql/tests,regcore_read/tests,regcore_write/tests

[coverage]
source = regcore,regcore_pgsql,regcore_read,regcore_write

[flake8]
exclude = regcore/migrations/*.py,regcore/settings/*.py

[isort]
known_third_party=six

[pytest]
python_files = tests_*.py *_test.py *_tests.py
DJANGO_SETTINGS_MODULE = regcore.settings.base

[travis]
python =
  3.6: py36, lint, docs