aboutsummaryrefslogtreecommitdiff
path: root/tox.ini
blob: ae8b21677a0c9b92fee81e4a07e7782ecbdd23c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
[tox]
minversion = 3.0
envlist = lint, py3{8,9,10,11,12}-cov, htmlcov
skip_missing_interpreters=true

[testenv]
setenv =
    cy: FONTTOOLS_WITH_CYTHON=1
# 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
# 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}
deps =
    cov: coverage>=4.3
    pytest>=7.0.0
    pytest-randomly
    # add -noextra to tox -e to skip installing extras and only test the core fonttools
    !noextra: -rrequirements.txt
commands =
    cy: python -c "from fontTools.cu2qu.cu2qu import COMPILED; assert COMPILED"
    !cy: python -c "from fontTools.cu2qu.cu2qu import COMPILED; assert not COMPILED"
    # test with or without coverage, passing extra positonal args to pytest
    cov: coverage run --parallel-mode -m pytest {posargs}
    !cov: pytest {posargs:Tests fontTools}

[testenv:htmlcov]
deps =
    coverage>=4.3
skip_install = true
commands =
    coverage combine
    coverage html

[testenv:lint]
deps =
    -r dev-requirements.txt
skip_install = true
commands =
    black --check --diff .
    mypy

[testenv:codecov]
passenv = *
deps =
    coverage>=4.3
    codecov
skip_install = true
ignore_outcome = true
commands =
    coverage combine
    codecov --env TOXENV

[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/*

[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
    python -c 'import shutil; shutil.rmtree("dist", ignore_errors=True)'
    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

[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