2015-12-12 17:52:18 +00:00
|
|
|
[tox]
|
2018-07-25 19:12:17 +01:00
|
|
|
minversion = 3.0
|
2024-10-07 22:28:58 +01:00
|
|
|
envlist = lint, py3{8,9,10,11,12,13}-cov, htmlcov
|
2020-05-15 10:06:27 +01:00
|
|
|
skip_missing_interpreters=true
|
2015-12-12 17:52:18 +00:00
|
|
|
|
|
|
|
[testenv]
|
2020-04-02 19:31:08 +01:00
|
|
|
setenv =
|
|
|
|
cy: FONTTOOLS_WITH_CYTHON=1
|
2020-09-28 19:55:12 +01:00
|
|
|
# use 'download = true' to have tox install the latest pip inside the virtualenv.
|
|
|
|
# We need this to be able to install skia-pathops on Linux, which uses a
|
|
|
|
# relatively recent 'manylinux2014' platform tag.
|
|
|
|
# https://github.com/tox-dev/tox/issues/791#issuecomment-518713438
|
|
|
|
download = true
|
2022-11-14 13:48:39 +00:00
|
|
|
# building lxml from source takes too long on CI, force it to download pre-compiled
|
|
|
|
# wheel or fail if none is found with --only-binary=lxml
|
|
|
|
install_command = python -m pip install --only-binary=lxml {opts} {packages}
|
2024-03-04 15:54:51 +00:00
|
|
|
# exclude pytest 8.0.{1,2} because our tests mysteriously fail with those
|
|
|
|
# https://github.com/fonttools/fonttools/issues/3458
|
2015-12-12 17:52:18 +00:00
|
|
|
deps =
|
2016-12-31 13:33:24 +01:00
|
|
|
cov: coverage>=4.3
|
2024-03-04 15:54:51 +00:00
|
|
|
pytest>=7.0.0,!=8.0.1,!=8.0.2
|
2019-06-11 13:22:20 +01:00
|
|
|
pytest-randomly
|
2023-05-24 16:28:53 +01:00
|
|
|
# add -noextra to tox -e to skip installing extras and only test the core fonttools
|
|
|
|
!noextra: -rrequirements.txt
|
2015-12-12 17:52:18 +00:00
|
|
|
commands =
|
2020-04-02 19:31:08 +01:00
|
|
|
cy: python -c "from fontTools.cu2qu.cu2qu import COMPILED; assert COMPILED"
|
|
|
|
!cy: python -c "from fontTools.cu2qu.cu2qu import COMPILED; assert not COMPILED"
|
2018-10-18 15:35:02 +01:00
|
|
|
# test with or without coverage, passing extra positonal args to pytest
|
2020-05-15 10:42:59 +01:00
|
|
|
cov: coverage run --parallel-mode -m pytest {posargs}
|
2018-11-15 08:47:20 +00:00
|
|
|
!cov: pytest {posargs:Tests fontTools}
|
2015-12-12 17:52:18 +00:00
|
|
|
|
2016-12-26 13:49:31 +00:00
|
|
|
[testenv:htmlcov]
|
2016-10-14 15:18:28 +01:00
|
|
|
deps =
|
2016-12-31 13:33:24 +01:00
|
|
|
coverage>=4.3
|
2016-10-14 15:18:28 +01:00
|
|
|
skip_install = true
|
2016-12-26 13:49:31 +00:00
|
|
|
commands =
|
|
|
|
coverage combine
|
2017-04-10 12:23:12 +01:00
|
|
|
coverage html
|
2016-10-14 15:18:28 +01:00
|
|
|
|
2022-12-13 11:26:00 +00:00
|
|
|
[testenv:lint]
|
2020-09-16 15:13:50 +01:00
|
|
|
deps =
|
|
|
|
-r dev-requirements.txt
|
|
|
|
skip_install = true
|
|
|
|
commands =
|
2022-12-13 11:26:00 +00:00
|
|
|
black --check --diff .
|
2020-09-16 15:13:50 +01:00
|
|
|
mypy
|
|
|
|
|
2016-12-26 13:49:31 +00:00
|
|
|
[testenv:codecov]
|
|
|
|
passenv = *
|
2016-04-11 00:17:14 +01:00
|
|
|
deps =
|
2016-12-31 13:33:24 +01:00
|
|
|
coverage>=4.3
|
2016-12-26 13:49:31 +00:00
|
|
|
codecov
|
2016-04-11 00:17:14 +01:00
|
|
|
skip_install = true
|
|
|
|
ignore_outcome = true
|
2016-12-26 13:49:31 +00:00
|
|
|
commands =
|
|
|
|
coverage combine
|
|
|
|
codecov --env TOXENV
|
2016-12-26 19:36:08 +00:00
|
|
|
|
2018-11-01 13:11:12 +00:00
|
|
|
[testenv:package_readme]
|
|
|
|
description = check that the long description is valid (need for PyPi)
|
|
|
|
deps = twine >= 1.12.1
|
|
|
|
pip >= 18.0.0
|
|
|
|
skip_install = true
|
|
|
|
extras =
|
|
|
|
commands = pip wheel -w {envtmpdir}/build --no-deps .
|
|
|
|
twine check {envtmpdir}/build/*
|
|
|
|
|
2016-12-26 19:36:08 +00:00
|
|
|
[testenv:bdist]
|
|
|
|
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
|
2018-09-11 12:09:50 +02:00
|
|
|
python -c 'import shutil; shutil.rmtree("dist", ignore_errors=True)'
|
2016-12-26 19:36:08 +00:00
|
|
|
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
|
2018-09-11 12:09:50 +02:00
|
|
|
|
|
|
|
[testenv:pypi]
|
|
|
|
deps =
|
|
|
|
{[testenv:bdist]deps}
|
|
|
|
twine
|
|
|
|
skip_install = true
|
|
|
|
passenv = TWINE_USERNAME TWINE_PASSWORD
|
|
|
|
commands =
|
|
|
|
{[testenv:bdist]commands}
|
|
|
|
twine upload dist/*.whl dist/*.zip
|