adjutant/tox.ini
Dale Smith 8ae383f9fe Fix gates for Antelope and update Django
* Zuul deprecated (and now removed) declaring shared queues at a pipeline
  level [1]. This patch fixes the syntax to make the gate work for
  adjutant.
* Updates Django version to allow upper-constraints version
* Fix Django 3.2 warnings
* Fix flake8 errors
* Remove support for Python 3.6, Python 3.7

[1] https://lists.openstack.org/pipermail/openstack-discuss/2022-May/028603.html

Change-Id: Ic369b59bb062df867d78b006f06e48cf9c98a3ee
2022-12-07 19:52:27 +13:00

75 lines
2.1 KiB
INI

[tox]
envlist = py3,pep8,black_check,cover_report
skipsdist = True
minversion = 3.1.1
ignore_basepython_conflict = True
[testenv]
usedevelop = True
basepython = python3
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands =
find adjutant -type f -name "*.pyc" -delete
adjutant-api test {posargs}
setenv = VIRTUAL_ENV={envdir}
whitelist_externals =
find
[testenv:pep8]
commands =
flake8
doc8
[testenv:cover]
commands =
coverage run --source='adjutant' .tox/cover/bin/adjutant-api test {posargs}
coverage html -d cover
coverage xml -o cover/coverage.xml
[testenv:cover_report]
commands =
coverage run --source='.' .tox/cover_report/bin/adjutant-api test {posargs}
coverage report --include adjutant/* -m
[testenv:venv]
commands = {posargs}
[testenv:docs]
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/doc/requirements.txt
commands =
sphinx-build -W -b html -d doc/build/doctrees doc/source doc/build/html
[testenv:api-ref]
deps = {[testenv:docs]deps}
commands =
sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
[testenv:releasenotes]
deps = {[testenv:docs]deps}
commands = sphinx-build -a -E -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[flake8]
max-line-length = 88
select = C,E,F,W,B,B950
ignore = D100,D101,D102,D103,D104,D105,D200,D203,D202,D204,D205,D208,D400,D401,W503,E203,E231,E501
show-source = true
builtins = _
exclude=.venv,venv,.env,env,.git,.tox,dist,doc,*lib/python*,*egg,releasenotes,adjutant/api/migrations/*,adjutant/actions/migrations,adjutant/tasks/migrations
[doc8]
ignore-path=.tox,*.egg-info,doc/build,releasenotes/build,api-ref/build,.eggs/*/EGG-INFO/*.txt,./*.txt,adjutant
extension=.txt,.rst,.inc
[testenv:black]
commands =
black -t py38 --exclude /(\.tox|\.venv|.*venv.*|build|dist)/ .
[testenv:black_check]
commands =
black -t py38 --exclude /(\.tox|\.venv|.*venv.*|build|dist)/ --check .