summaryrefslogtreecommitdiff
path: root/tox.ini
blob: e158f90fa23d7ef764beca88ec6a4e7166e7dbfe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
[tox]
minversion = 3.1
envlist = pep8,py27,py37,docs
ignore_basepython_conflict = True

[testenv]
usedevelop = True
basepython = python3
passenv = PBR_INTEGRATION PIPFLAGS PIPVERSION PBRVERSION REPODIR WHEELHOUSE PROJECTS
# TODO(fungi): drop distutils override once logging improves in Setuptools
#              https://github.com/pypa/setuptools/issues/3038
setenv =
  SETUPTOOLS_USE_DISTUTILS=stdlib
  OS_STDOUT_CAPTURE={env:OS_STDOUT_CAPTURE:1}
  OS_STDERR_CAPTURE={env:OS_STDERR_CAPTURE:1}
  OS_TEST_TIMEOUT={env:OS_TEST_TIMEOUT:60}
# NOTE(stephenfin): pbr intentionally does not use constraints since we support
# a broader range of Python versions than OpenStack as a whole
deps =
  -r{toxinidir}/test-requirements.txt
commands = stestr run --suppress-attachments {posargs}

[testenv:pep8]
commands = pre-commit run -a

[testenv:docs]
whitelist_externals = rm
deps =
  -r{toxinidir}/doc/requirements.txt
commands =
  rm -rf doc/build doc/source/reference/api
  python setup.py sdist
  sphinx-build -W -b html doc/source doc/build/html {posargs}

[testenv:releasenotes]
whitelist_externals = rm
deps = {[testenv:docs]deps}
commands =
  rm -rf releasenotes/build
  sphinx-build -W -b html -d releasenotes/build/doctrees releasenotes/source releasenotes/build/html

[testenv:venv]
commands = {posargs}

[testenv:cover]
# TODO(fungi): drop distutils override once logging improves in Setuptools
#              https://github.com/pypa/setuptools/issues/3038
setenv =
  SETUPTOOLS_USE_DISTUTILS=stdlib
  PYTHON=coverage run --source pbr --parallel-mode
commands =
  stestr run {posargs}
  coverage combine
  coverage html -d cover
  coverage xml -o cover/coverage.xml

[flake8]
# W504 (you have to choose this or W503)
ignore = W504
exclude = .venv,.tox,dist,doc,*.egg,build
show-source = true