fonttools/tox.ini

80 lines
2.2 KiB
INI

[tox]
envlist = py{27,36,37}-cov,py{27,36,37}-cov-lxml,coverage
minversion = 2.9.1
skip_missing_interpreters = true
[testenv]
basepython =
# we use TOXPYTHON env variable to specify the location of Appveyor Python
py27: {env:TOXPYTHON:python2.7}
py35: {env:TOXPYTHON:python3.5}
py36: {env:TOXPYTHON:python3.6}
py37: {env:TOXPYTHON:python3.7}
description = run the tests with pytest under {basepython}
setenv =
COVERAGE_FILE={toxinidir}/.coverage.{envname}
deps =
-rrequirements.txt
lxml: -rextra_requirements.txt
extras = testing
commands =
nocov: pytest {posargs}
cov: pytest --cov="{envsitepackagesdir}/ufoLib" --cov-config={toxinidir}/.coveragerc {posargs}
[testenv:coverage]
description = run locally after tests to combine coverage data and create reports;
generates a diff coverage against origin/master (or DIFF_AGAINST env var)
basepython = {env:TOXPYTHON:python}
deps =
coverage >= 4.4.1, < 5
diff_cover
skip_install = true
setenv =
COVERAGE_FILE={toxinidir}/.coverage
passenv =
DIFF_AGAINST
changedir = {toxinidir}
commands =
coverage erase
coverage combine
coverage report
coverage xml -o {toxworkdir}/coverage.xml
coverage html
diff-cover --compare-branch {env:DIFF_AGAINST:origin/master} {toxworkdir}/coverage.xml
[testenv:codecov]
description = upload coverage data to codecov (only run on CI)
basepython = {env:TOXPYTHON:python}
deps =
{[testenv:coverage]deps}
codecov
skip_install = true
setenv = {[testenv:coverage]setenv}
passenv = TOXENV CI TRAVIS TRAVIS_* APPVEYOR APPVEYOR_* CODECOV_*
changedir = {toxinidir}
commands =
coverage combine
codecov --env TOXENV
[testenv:sdist]
description = build sdist to be uploaded to PyPI
basepython = {env:TOXPYTHON:python}
skip_install = true
deps =
setuptools >= 36.4.0
wheel >= 0.31.0
changedir = {toxinidir}
commands =
python -c 'import shutil; shutil.rmtree("dist", ignore_errors=True)'
python setup.py sdist --dist-dir dist
[testenv:wheel]
description = build wheel package for upload to PyPI
basepython = {env:TOXPYTHON:python}
skip_install = true
deps = {[testenv:sdist]deps}
changedir = {toxinidir}
commands =
{[testenv:sdist]commands}
pip wheel --no-deps --wheel-dir dist --find-links dist ufoLib