File: tox.ini

package info (click to toggle)
python-structlog 25.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,416 kB
  • sloc: python: 8,182; makefile: 138
file content (113 lines) | stat: -rw-r--r-- 2,985 bytes parent folder | download
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
[tox]
min_version = 4
env_list =
    pre-commit,
    mypy-pkg,
    py3{8,9,10,11,12,13,14}-{tests,mypy}
    py3{8,13}-tests-{colorama,be,rich},
    docs-{sponsors,doctests},
    coverage-report


[testenv]
package = wheel
wheel_build_env = .pkg
dependency_groups =
    tests: tests
    mypy: typing
commands =
    tests: pytest {posargs}
    mypy: mypy tests/typing


# Run oldest and latest under Coverage.
# Keep in-sync with coverage `depends below.
[testenv:py3{8,13}-tests{,-colorama,-be,-rich}]
deps =
    coverage[toml]
    py313: twisted
    colorama: colorama
    rich: rich
    be: better-exceptions
commands = coverage run -m pytest {posargs}


[testenv:coverage-report]
deps = coverage[toml]
skip_install = true
parallel_show_output = true
# Keep in-sync with test env definition above.
depends = py3{8,13}-{tests,colorama,be,rich}
commands =
    coverage combine
    coverage report


[testenv:docs-{build,doctests,linkcheck}]
# Keep base_python in sync with ci.yml/docs and .readthedocs.yaml.
base_python = py313
dependency_groups = docs
commands =
    build: sphinx-build -n -T -W -b html -d {envtmpdir}/doctrees docs {posargs:docs/_build/}html
    doctests: sphinx-build -n -T -W -b doctest -d {envtmpdir}/doctrees docs {posargs:docs/_build/}html
    linkcheck: sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees docs docs/_build/html

[testenv:docs-watch]
package = editable
base_python = {[testenv:docs-build]base_python}
dependency_groups = {[testenv:docs-build]dependency_groups}
deps = watchfiles
commands =
    watchfiles \
        --ignore-paths docs/_build/ \
        'sphinx-build -W -n --jobs auto -b html -d {envtmpdir}/doctrees docs docs/_build/html' \
        src \
        docs

[testenv:docs-sponsors]
description = Ensure sponsor logos are up to date.
deps = cogapp
commands = cog -rP README.md docs/index.md


[testenv:pre-commit]
skip_install = true
deps = pre-commit
commands = pre-commit run --all-files


[testenv:mypy-pkg]
dependency_groups = typing
commands = mypy src


[testenv:pyright]
deps = pyright
dependency_groups = typing
commands = pyright tests/typing


[testenv:color-force]
help = A visual check that FORCE_COLOR is working.
set_env = FORCE_COLOR=1
commands = python -c "import structlog; structlog.get_logger().warning('should be colorful')"


[testenv:color-no]
help = A visual check that NO_COLOR is working.
set_env = NO_COLOR=1
commands = python -c "import structlog; structlog.get_logger().warning('should be plain')"


[testenv:docset]
deps = doc2dash
dependency_groups = docs
allowlist_externals =
    rm
    cp
    tar
commands =
    rm -rf structlog.docset structlog.tgz docs/_build
    sphinx-build -n -T -W -b html -d {envtmpdir}/doctrees docs docs/_build/html
    doc2dash --index-page index.html --icon docs/_static/docset-icon.png --icon-2x docs/_static/docset-icon@2x.png --online-redirect-url https://www.structlog.org/en/latest/ docs/_build/html
    tar --exclude='.DS_Store' -cvzf structlog.tgz structlog.docset