|
1 | 1 | [tox]
|
2 |
| -# env names must be a valid python binary name, unless they have a |
3 |
| -# separate configuration |
4 |
| -envlist = |
5 |
| - python{2.7,3.4,3.5,3.6}, pypy{,3}, crosspython{2,3}, docs |
| 2 | +minversion = 3.3.0 |
| 3 | +envlist = py{27,34,35,36,37}, pypy{,3}, cross_python{2,3}, docs, package_readme |
| 4 | +isolated_build = true |
| 5 | +skip_missing_interpreters = true |
6 | 6 |
|
7 | 7 | [testenv]
|
| 8 | +description = run tests with {basepython} |
| 9 | +setenv = PIP_DISABLE_VERSION_CHECK = 1 |
| 10 | + COVERAGE_FILE = {env:COVERAGE_FILE:{toxworkdir}/.coverage.{envname}} |
| 11 | +deps = mock |
| 12 | + pytest >= 3.0.0, <4 |
| 13 | + pytest-cov >= 2.5.1, <3 |
| 14 | + pytest-mock >= 1.10.0, <2 |
| 15 | + pytest-timeout >= 1.3.0, <2 |
| 16 | +commands = pytest {posargs:\ |
| 17 | + --cov="virtualenv" \ |
| 18 | + --cov-config="{toxinidir}/tox.ini" \ |
| 19 | + --timeout=180 \ |
| 20 | + --junitxml={env:JUNIT_XML_FILE:{toxworkdir}/.test.{envname}.xml} \ |
| 21 | + . } |
| 22 | + |
| 23 | +[coverage:run] |
| 24 | +branch = true |
| 25 | + |
| 26 | +[coverage:report] |
| 27 | +skip_covered = True |
| 28 | +show_missing = True |
| 29 | + |
| 30 | +[coverage:paths] |
| 31 | +source = virtualenv |
| 32 | + .tox/*/lib/python*/site-packages/virtualenv |
| 33 | + .tox/pypy*/site-packages/virtualenv |
| 34 | + .tox\*\Lib\site-packages\virtualenv |
| 35 | + */virtualenv |
| 36 | + *\virtualenv |
| 37 | + |
| 38 | +[testenv:cross_python2] |
| 39 | +description = test creating a python3 venv with a python2-based virtualenv |
| 40 | +basepython = python2 |
8 | 41 | deps =
|
9 |
| - mock |
10 |
| - pytest |
11 |
| -commands = |
12 |
| - py.test |
13 |
| - |
14 |
| -# Creating a python3 venv with a python2-based virtualenv |
15 |
| -[testenv:crosspython2] |
16 |
| -basepython=python2 |
17 |
| -deps = |
18 |
| -commands = |
19 |
| - virtualenv -p python3 {envtmpdir}/{envname} |
20 |
| - {envtmpdir}/{envname}/bin/python -V 2>&1 | grep "Python 3" |
| 42 | +commands = virtualenv -p python3 {envtmpdir}/{envname} |
| 43 | + {envtmpdir}/{envname}/bin/python -V 2>&1 | grep "Python 3" |
| 44 | + |
21 | 45 |
|
22 |
| -# Creating a python2 venv with a python3-based virtualenv |
23 |
| -[testenv:crosspython3] |
24 |
| -basepython=python3 |
| 46 | +[testenv:cross_python3] |
| 47 | +description = test creating a python2 venv with a python3-based virtualenv |
| 48 | +basepython = python3 |
25 | 49 | deps =
|
26 |
| -commands = |
27 |
| - virtualenv -p python2 {envtmpdir}/{envname} |
28 |
| - {envtmpdir}/{envname}/bin/python -V 2>&1 | grep "Python 2" |
| 50 | +commands = virtualenv -p python2 {envtmpdir}/{envname} |
| 51 | + {envtmpdir}/{envname}/bin/python -V 2>&1 | grep "Python 2" |
29 | 52 |
|
30 | 53 | [testenv:docs]
|
31 |
| -deps = |
32 |
| - sphinx |
33 |
| - readme |
34 |
| -commands = |
35 |
| - sphinx-build -W -b html -d {envtmpdir}/doctrees docs docs/_build/html |
36 |
| - python setup.py check -m -r -s |
| 54 | +basepython = python3 |
| 55 | +description = build documentation |
| 56 | +deps = sphinx |
| 57 | +commands = sphinx-build -d "{envtmpdir}/doctree" docs "{toxworkdir}/docs_out" --color -W -bhtml {posargs} |
| 58 | + python -c 'import pathlib; print("documentation available under file://\{0\}".format(pathlib.Path(r"{toxworkdir}") / "docs_out" / "index.html"))' |
| 59 | + |
| 60 | +[testenv:package_readme] |
| 61 | +description = check that the long description is valid (need for PyPi) |
| 62 | +deps = twine >= 1.12.1 |
| 63 | + pip >= 18.0.0 |
| 64 | +skip_install = true |
| 65 | +extras = |
| 66 | +commands = pip wheel -w {envtmpdir}/build --no-deps . |
| 67 | + twine check {envtmpdir}/build/* |
0 commit comments