Newer
Older
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
62
63
64
65
66
67
68
69
70
# Tox runner configuration
#
# The following optional environment variables can change behaviour. See the
# comments where they are used for more information.
#
# - TOXINI_ARTEFACT_DIR
# - TOXINI_FLAKE8_VERSION
# - TOXINI_WORK_DIR
#
[tox]
# Envs which should be run by default.
envlist=flake8,doc,py3
# Allow overriding toxworkdir via environment variable
toxworkdir={env:TOXINI_WORK_DIR:{toxinidir}/.tox}
# Avoid .egg-info directories
skipsdist=True
# The "_vars" section is ignored by tox but we place some useful shared
# variables in it to avoid needless repetition.
[_vars]
# Where to write build artefacts. We default to the "build" directory in the
# tox.ini file's directory. Override with the TOXINI_ARTEFACT_DIR environment
# variable.
build_root={env:TOXINI_ARTEFACT_DIR:{toxinidir}/build}
[testenv]
# Additional dependencies
deps=
-rrequirements.txt
coverage
pytest
pytest-cov
# Which environment variables should be passed into the environment.
passenv=
# Allow people to override the coverage report location should they so wish.
COVERAGE_FILE
# Location of the coverage.xml file
COVERAGE_XML_FILE
# How to run the test suite. Note that arguments passed to tox are passed on to
# the test command.
commands=
pytest --doctest-modules --cov={toxinidir} --junitxml={[_vars]build_root}/{envname}/junit.xml
coverage html --directory {[_vars]build_root}/{envname}/htmlcov/
coverage xml -o {env:COVERAGE_XML_FILE:{[_vars]build_root}/{envname}/coverage.xml}
# Allow sitepackages setting to be overridden via TOX_SITEPACKAGES environment
# variable. The tox container uses this to avoid re-installing the same packages
# over and over again.
sitepackages={env:TOXINI_SITEPACKAGES:False}
[testenv:py3]
basepython=python3
# Build documentation
[testenv:doc]
basepython=python3
deps=
-rdoc/requirements.txt
commands=sphinx-build -a -v -b html doc/ {[_vars]build_root}/doc/
# Check for PEP8 violations
[testenv:flake8]
basepython=python3
deps=
# We specify a specific version of flake8 to avoid introducing "false"
# regressions when new checks are introduced. The version of flake8 used may
# be overridden via the TOXINI_FLAKE8_VERSION environment variable.
flake8=={env:TOXINI_FLAKE8_VERSION:3.6.0}
commands=
flake8 --version
flake8 .