fonttools/tox.ini

98 lines
2.5 KiB
INI

[tox]
envlist = py{27,37}-{cy,nocy}, htmlcov
package_name = cu2qu
; we skip tox's own sdist generation as we need to pass different environment
; variables for testing buiding with and without cython
skipsdist = true
[testenv]
setenv =
nocy: CU2QU_WITH_CYTHON=0
cy: CU2QU_WITH_CYTHON=1
cy: CYTHON_TRACE=1
cy: CYTHON_ANNOTATE=1
; download the latest pip, setuptools and wheel when creating the venv
download = true
deps =
-rtest-requirements.txt
-rrequirements.txt
cy: cython
changedir = {toxinidir}
commands =
# create source distribution in a temp dir
python setup.py --quiet sdist --dist-dir {envtmpdir}
# install from sdist
python -m pip install --no-build-isolation --ignore-installed --pre --no-deps --no-cache-dir --find-links {envtmpdir} {[tox]package_name}
# ensure we are running the requested cu2qu version (compiled vs interpreted)
nocy: python -c "import sys, cu2qu.cu2qu; cu2qu.cu2qu.COMPILED and sys.exit(1)"
cy: python -c "import sys, cu2qu.cu2qu; cu2qu.cu2qu.COMPILED or sys.exit(1)"
# run tests with code coverage enabled
coverage run --parallel-mode -m pytest {posargs}
[testenv:htmlcov]
deps =
coverage
changedir = {toxinidir}
commands =
coverage combine
coverage report
coverage html
[testenv:codecov]
passenv = *
deps =
coverage
codecov
ignore_outcome = true
changedir = {toxinidir}
commands =
coverage combine
codecov --env TRAVIS_PYTHON_VERSION
[testenv:update-cython]
deps = requests
changedir = {toxinidir}
commands =
python tools/update_cython_shadow.py {posargs}
[testenv:sdist]
deps =
setuptools
cython
changedir = {toxinidir}
commands =
python -c 'import shutil; shutil.rmtree("dist", ignore_errors=True)'
python setup.py --with-cython sdist --dist-dir dist
[testenv:pure-wheel]
deps =
{[testenv:sdist]deps}
pip
wheel
setenv = CU2QU_WITH_CYTHON=0
changedir = {toxinidir}
commands =
{[testenv:sdist]commands}
pip wheel --pre --no-deps --no-cache-dir --wheel-dir dist --find-links dist \
--no-binary {[tox]package_name} {[tox]package_name}
[testenv:native-wheel]
deps = {[testenv:pure-wheel]deps}
setenv = CU2QU_WITH_CYTHON=1
changedir = {toxinidir}
commands = {[testenv:pure-wheel]commands}
; we only upload the source distribution to PyPI (for now)
[testenv:pypi]
deps =
{[testenv:sdist]deps}
twine
passenv = TWINE_USERNAME TWINE_PASSWORD
changedir = {toxinidir}
commands =
{[testenv:sdist]commands}
twine upload dist/*.zip