fonttools/tox.ini
Cosimo Lupo e5e795ac9f
[tox] don't pass {posargs} to coverage in 'htmlcov' env
The {posargs} are global for the current tox process, and we already use them to pass additional arguments to the pytest command in the default testenv, so we can't at the same time also use them to pass options to coverage.py.

The 'htmlcov' tox environment produces the combined coverage.py report, and store it in htmlcov/index.html; this is listed in the tox.ini 'envlist', so it is run by default at every 'tox' invocation, when no explicit env list is passed via either -e option or $TOXENV variable.

The options to `coverage html` are not much interesting anyway; it's much more useful being able to, e.g., run tox for specific tests matching a string or expression:

$ tox -- -k "feaLib"
2017-04-10 12:23:12 +01:00

65 lines
1.6 KiB
INI

[tox]
envlist = py{27,36}-cov, htmlcov
[testenv]
basepython =
py27: {env:TOXPYTHON:python2.7}
pypy: {env:TOXPYTHON:pypy}
py34: {env:TOXPYTHON:python3.4}
py35: {env:TOXPYTHON:python3.5}
py36: {env:TOXPYTHON:python3.6}
deps =
cov: coverage>=4.3
pytest
-rrequirements.txt
install_command =
pip install -v {opts} {packages}
commands =
# run the test suite against the package installed inside tox env.
# We use parallel mode and then combine later so that coverage.py will take
# paths like .tox/py36/lib/python3.6/site-packages/fontTools and collapse
# them into Lib/fontTools.
cov: coverage run --parallel-mode -m pytest {posargs}
nocov: pytest {posargs}
[testenv:htmlcov]
basepython = {env:TOXPYTHON:python3.5}
deps =
coverage>=4.3
skip_install = true
commands =
coverage combine
coverage html
[testenv:codecov]
passenv = *
basepython = {env:TOXPYTHON:python}
deps =
coverage>=4.3
codecov
skip_install = true
ignore_outcome = true
commands =
coverage combine
codecov --env TOXENV
[testenv:bdist]
basepython = {env:TOXPYTHON:python3.5}
deps =
setuptools
wheel
skip_install = true
install_command =
# make sure we use the latest setuptools and wheel
pip install --upgrade {opts} {packages}
whitelist_externals =
rm
commands =
# clean up build/ and dist/ folders
rm -rf {toxinidir}/dist
python setup.py clean --all
# build sdist
python setup.py sdist --dist-dir {toxinidir}/dist
# build wheel from sdist
pip wheel -v --no-deps --no-index --wheel-dir {toxinidir}/dist --find-links {toxinidir}/dist fonttools