1# ============================================================================
2# TOX CONFIGURATION: parse_type
3# ============================================================================
4# DESCRIPTION:
5#
6#   Use tox to run tasks (tests, ...) in a clean virtual environment.
7#   Tox is configured by default for online usage.
8#
9#   Run tox, like:
10#
11#       tox -e py27
12#       tox -e py37
13#
14# SEE ALSO:
15#   * https://tox.readthedocs.io/en/latest/config.html
16# ============================================================================
17# -- ONLINE USAGE:
18# PIP_INDEX_URL = https://pypi.org/simple
19
20[tox]
21minversion = 3.10.0
22envlist    = py27, py37, py38, pypy, pypy3, doctest
23skip_missing_interpreters = True
24sitepackages = False
25indexserver =
26    default = https://pypi.org/simple
27
28
29# -----------------------------------------------------------------------------
30# TEST ENVIRONMENTS:
31# -----------------------------------------------------------------------------
32# install_command = pip install -U {opts} {packages}
33[testenv]
34changedir = {toxinidir}
35commands =
36    pytest {posargs:tests}
37deps =
38    pytest <  5.0; python_version <  '3.0'  # >= 4.2
39    pytest >= 5.0; python_version >= '3.0'
40    pytest-html >= 1.19.0
41setenv =
42    TOXRUN = yes
43    PYSETUP_BOOTSTRAP = no
44
45
46[testenv:doctest]
47commands =
48    pytest --doctest-modules -v parse_type
49
50
51# -----------------------------------------------------------------------------
52# MORE TEST ENVIRONMENTS:
53# -----------------------------------------------------------------------------
54[testenv:coverage]
55commands =
56    pytest --cov=parse_type {posargs:tests}
57    coverage combine
58    coverage html
59    coverage xml
60deps =
61    {[testenv]deps}
62    pytest-cov
63    coverage>=4.0
64
65[testenv:install]
66changedir = {envdir}
67commands =
68    python ../../setup.py install -q
69    {toxinidir}/bin/toxcmd.py copytree ../../tests .
70    pytest {posargs:tests}
71deps =
72    pytest>=3.2
73
74
75# -----------------------------------------------------------------------------
76# SELDOM USED TEST ENVIRONMENTS:
77# -----------------------------------------------------------------------------
78# -- ENSURE: README.rst is well-formed.
79# python setup.py --long-description | rst2html.py >output.html
80; [testenv:check_setup]
81; changedir = {toxinidir}
82; commands=
83;     python setup.py --long-description > output.tmp
84;     rst2html.py output.tmp output.html
85; deps =
86;     docutils
87