alainivars/drf-microservice

View on GitHub
tox.ini

Summary

Maintainability
Test Coverage
[pytest]
DJANGO_SETTINGS_MODULE=my_api.settings.qa
addopts=--tb=short
# -- recommended but optional:
python_files = tests.py test_*.py *_tests.py

[tox]
minversion=2.5
toxworkdir=.tox
envlist =
    py{39,310}-django{22,31,master},
    pep8,dist,lint,docs,coverage_combine,

[testenv]
skip_install = True
deps =
    django22: Django>=2.2,<3.0
    django31: Django>=3.1,<3.2
    djangomaster: django==4.0.5
    -r{toxinidir}/requirements.txt
    -r{toxinidir}/requirements/tests.txt
    -r{toxinidir}/requirements/codestyle.txt
commands =
    /usr/bin/env DJANGO_SECRET_KEY=test pytest --ds=my_api.settings.qa -v --cov my_api/rest --cov-report term-missing

[testenv:plint]
commands = py.test --pylint
deps =
    django
    -r{toxinidir}/requirements/tests.txt

[testenv:dist]
commands = python {toxinidir}/setup.py sdist bdist_wheel
deps =
    django
    -r{toxinidir}/requirements/tests.txt
    -r{toxinidir}/requirements/packaging.txt

[testenv:docs]
skip_install = True
changedir=docs
deps =
    -r{toxinidir}/requirements.txt
    -r{toxinidir}/requirements/docgen.txt
    -r{toxinidir}/requirements/codestyle.txt
commands=
    sphinx-build -b html -c {envtmpdir}/../../.. -d {envtmpdir}/doctrees . {envtmpdir}/html
    # to check like readthedoc before to commit and push
;    sphinx-build -T -E -d _build/doctrees-readthedocs -D language=en . _build/html

[testenv:pep8]
skip_install = True
whitelist_externals = pep8
deps =
    -r{toxinidir}/requirements.txt
    -r{toxinidir}/requirements/tests.txt
    -r{toxinidir}/requirements/codestyle.txt
commands =
    pycodestyle --max-line-length 95 my_api