File: tox.ini

package info (click to toggle)
python-build 1.2.2-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 508 kB
  • sloc: python: 2,622; makefile: 16
file content (117 lines) | stat: -rw-r--r-- 2,885 bytes parent folder | download | duplicates (2)
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
[tox]
requires =
    tox>=4.2
    virtualenv>=20.0.34
env_list =
    fix
    type
    docs
    path
    {py312, py311, py310, py39, py38, pypy310, pypy39, pypy38}{, -min}
skip_missing_interpreters = true

[testenv]
description =
    run test suite with {basepython}
extras =
    test
pass_env =
    LC_ALL
    PIP_*
    PYTEST_*
    TERM
set_env =
    COVERAGE_FILE = {toxworkdir}/.coverage.{envname}
    PYPY3323BUG = 1
    PYTHONWARNDEFAULTENCODING = 1
    TEST_STATUS_DIR = {envtmpdir}
commands =
    pytest -ra --cov --cov-config pyproject.toml \
      --cov-report=html:{envdir}/htmlcov --cov-context=test \
      --cov-report=xml:{toxworkdir}/coverage.{envname}.xml {posargs:-n auto}

[testenv:fix]
description = run static analysis and style checks
base_python = python3.9
skip_install = true
deps =
    pre-commit>=2
pass_env =
    HOMEPATH
    PROGRAMDATA
commands =
    pre-commit run --all-files --show-diff-on-failure
    python -c 'print("hint: run {envdir}/bin/pre-commit install to add checks as pre-commit hook")'

[testenv:type]
description = run type check on code base
extras =
    typing
set_env =
    PYTHONWARNDEFAULTENCODING =
commands =
    mypy

[testenv:docs]
description = build documentations
base_python = python3.10
extras =
    docs
commands =
    sphinx-build -n docs {envtmpdir} {posargs:-W}
    python -c 'print("Documentation available under file://{envtmpdir}/index.html")'

[testenv:path]
description = verify build can run from source (bootstrap)
set_env =
    COVERAGE_FILE = {toxworkdir}/.coverage.{envname}
    PYTHONPATH = {toxinidir}/src
commands_pre =
    python -E -m pip uninstall -y build colorama

[testenv:{py312, py311, py310, py39, py38, pypy38, pypy39, pypy310}-min]
description = check minimum versions required of all dependencies
skip_install = true
commands_pre =
    pip install .[test] -c tests/constraints.txt

[testenv:dev]
description = generate a DEV environment
package = editable
deps =
    virtualenv>=20.0.34
extras =
    doc
    test
commands =
    python -m pip list --format=columns
    python -c 'import sys; print(sys.executable)'

[testenv:coverage]
description = combine coverage from test environments
skip_install = true
deps =
    coverage[toml]>=5.1
    diff_cover>=3
parallel_show_output = true
pass_env =
    DIFF_AGAINST
set_env =
commands =
    coverage combine {toxworkdir}
    coverage report --skip-covered --show-missing -i
    coverage xml -o {toxworkdir}/coverage.xml -i
    coverage html -d {toxworkdir}/htmlcov -i
    python -m diff_cover.diff_cover_tool --compare-branch {env:DIFF_AGAINST:origin/main} {toxworkdir}/coverage.xml
depends =
    path
    {py312, py311, py310, py39, py38, pypy310, pypy39, pypy38}{, -min}

[testenv:bump]
description = bump versions, pass major/minor/patch
skip_install = true
deps =
    bump-my-version>=0.10
set_env =
commands =
    bump-my-version bump {posargs}