-
Notifications
You must be signed in to change notification settings - Fork 12
/
tox.ini
122 lines (108 loc) · 3.49 KB
/
tox.ini
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# ============================================================================
# TOX CONFIGURATION: parse_type
# ============================================================================
# DESCRIPTION:
# Use tox to run tasks (tests, ...) in a clean virtual environment.
# Tox is configured by default for online usage.
#
# Run tox, like:
#
# tox -e py27 # Runs tox with python 2.7
# tox -e py39 # Runs tox with python 3.9
# tox # Runs tox with all installed python versions.
# tox --parallel # Runs tox in parallel mode w/ all envs.
#
# SEE ALSO:
# * https://tox.readthedocs.io/en/latest/config.html
# ============================================================================
# -- ONLINE USAGE:
# PIP_INDEX_URL = https://pypi.org/simple
[tox]
minversion = 3.10.0
envlist = py312, py311, py310, py39, doctest, pypy3
skip_missing_interpreters = True
isolated_build = True
# DISABLED: sitepackages = False
# -----------------------------------------------------------------------------
# TEST ENVIRONMENTS:
# -----------------------------------------------------------------------------
# install_command = pip install -U {opts} {packages}
[testenv]
install_command = pip install -U {opts} {packages}
changedir = {toxinidir}
commands =
pytest {posargs:tests}
deps =
-r py.requirements/basic.txt
-r py.requirements/testing.txt
setenv =
PYTHONPATH={toxinidir}
TOXRUN = yes
PYSETUP_BOOTSTRAP = no
# -- SPECIAL CASE:
# RELATED: https://github.com/pypa/virtualenv/issues/2284 -- macOS 12 Monterey related
# NOTES:
# * pip-install seems to need "--user" option.
# * Script(s) do not seem to be installed any more (actually to $HOME/User area).
[testenv:py27]
# DISABLED: install_command = pip install --user -U {opts} {packages}
install_command = pip install -U {opts} {packages}
changedir = {toxinidir}
commands=
python -m pytest {posargs:tests}
deps=
{[testenv]deps}
passenv =
PYTHONPATH = {toxinidir}
# MAYBE: allowlist_externals = curl
# -- VIRTUAL-ENVIRONMENT SETUP PROCEDURE: For python 2.7
# virtualenv -p python2.7 .venv_py27
# source .venv_py27
# scripts/ensurepip_python27.sh
# python -m pip install -r py.requirements/basic.txt
# python -m pip install -r py.requirements/testing.txt
[testenv:doctest]
basepython = python3
commands =
pytest --doctest-modules -v parse_type
setenv =
PYTHONPATH={toxinidir}
# -----------------------------------------------------------------------------
# MORE TEST ENVIRONMENTS:
# -----------------------------------------------------------------------------
[testenv:coverage]
basepython = python3
commands =
pytest --cov=parse_type {posargs:tests}
coverage combine
coverage html
coverage xml
deps =
{[testenv]deps}
pytest-cov
coverage>=4.0
setenv =
PYTHONPATH={toxinidir}
[testenv:install]
basepython = python3
changedir = {envdir}
commands =
python ../../setup.py install -q
{toxinidir}/bin/toxcmd.py copytree ../../tests .
pytest {posargs:tests}
deps =
{[testenv]deps}
setenv =
PYTHONPATH={toxinidir}
# -----------------------------------------------------------------------------
# SELDOM USED TEST ENVIRONMENTS:
# -----------------------------------------------------------------------------
# -- ENSURE: README.rst is well-formed.
# python setup.py --long-description | rst2html.py >output.html
[testenv:check_setup]
changedir = {toxinidir}
commands=
python setup.py --long-description > output.tmp
rst2html.py output.tmp output.html
deps =
docutils