-
-
Notifications
You must be signed in to change notification settings - Fork 425
Expand file tree
/
Copy pathtox.ini
More file actions
153 lines (128 loc) · 4.11 KB
/
tox.ini
File metadata and controls
153 lines (128 loc) · 4.11 KB
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# SPDX-License-Identifier: MIT
[tox]
min_version = 4.25.0
env_list =
pre-commit,
py3{9-14}-tests,
py3{10-14}-mypy,
pypy3-tests,
# Mypy needs to run within the respective Python version
typing-{pyright,ty,pyrefly}
docs-{sponsors,doctests,build},
changelog,
coverage-{combine,report}
[pkgenv]
pass_env = SETUPTOOLS_SCM_PRETEND_VERSION
[testenv]
runner = uv-venv-lock-runner
package = wheel
wheel_build_env = .pkg
dependency_groups =
tests: tests
mypy: mypy
commands =
tests: pytest {posargs:-n auto}
mypy: pytest -k test_mypy
mypy: mypy typing-examples
mypy: mypy src/attrs/__init__.pyi src/attr/__init__.pyi src/attr/_typing_compat.pyi src/attr/_version_info.pyi src/attr/converters.pyi src/attr/exceptions.pyi src/attr/filters.pyi src/attr/setters.pyi src/attr/validators.pyi
[testenv:pypy3-tests]
dependency_groups = tests
commands = pytest tests/test_functional.py
# Keep versions in-sync with coverage-combine.
[testenv:py3{9,10,14}-tests]
dependency_groups = cov
# Python 3.6+ has a number of compile-time warnings on invalid string escapes.
# PYTHONWARNINGS=d makes them visible during the tox run.
set_env =
COVERAGE_PROCESS_START={toxinidir}/pyproject.toml
PYTHONWARNINGS=d
commands =
coverage run -m pytest {posargs:-n auto}
# Split combine/report in 2 to avoid excessive "Combined data file ..." output.
[testenv:coverage-combine]
# Keep base_python in-sync with .python-version-default
base_python = py314
# Keep depends in-sync with testenv above that has the cov dependency group.
depends = py3{9,10,14}-tests
skip_install = true
dependency_groups = cov
commands = coverage combine
[testenv:coverage-report]
# Keep base_python in-sync with .python-version-default
base_python = py314
depends = coverage-combine
parallel_show_output = true
skip_install = true
dependency_groups = cov
commands = coverage report
[testenv:codspeed]
dependency_groups = benchmark
pass_env =
CODSPEED_TOKEN
CODSPEED_ENV
ARCH
PYTHONHASHSEED
PYTHONMALLOC
commands = pytest --codspeed -n auto bench/test_benchmarks.py
[testenv:docs-{build,doctests,linkcheck}]
runner = uv-venv-lock-runner
# Keep base_python in-sync with .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 = docs-watch
deps = watchfiles
commands =
watchfiles \
--ignore-paths docs/_build/ \
'sphinx-build -W -n --jobs auto -b html -d {envtmpdir}/doctrees docs docs/_build/html' \
README.md \
src \
docs
[testenv:docs-sponsors]
runner = uv-venv-runner
skip_install = true
description = Ensure sponsor logos are up to date.
deps = cogapp
commands = cog -rP README.md docs/index.md
[testenv:pre-commit]
runner = uv-venv-runner
skip_install = true
deps = prek
commands = prek run --all-files
[testenv:changelog]
dependency_groups = docs
skip_install = true
commands =
towncrier --version
towncrier build --version main --draft
[testenv:typing-pyright]
dependency_groups = pyright
commands =
pyright typing-examples/baseline.py
pytest tests/test_pyright.py -vv
[testenv:typing-ty]
dependency_groups = ty
commands = ty check typing-examples/baseline.py
[testenv:typing-pyrefly]
dependency_groups = pyrefly
commands = pyrefly check typing-examples/baseline.py
[testenv:docset]
runner = uv-venv-runner
deps = doc2dash
dependency_groups = docs
allowlist_externals =
rm
cp
tar
commands =
rm -rf attrs.docset attrs.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.attrs.org/en/latest/ docs/_build/html
tar --exclude='.DS_Store' -cvzf attrs.tgz attrs.docset