-
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathtox.ini
More file actions
221 lines (201 loc) · 6.14 KB
/
tox.ini
File metadata and controls
221 lines (201 loc) · 6.14 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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
[tox]
minversion=2.0
isolated_build=True
envlist=
# Test all Python versions on latest lib versions
py3{10,11,12,13t,14,14t}-sphx_latest-attrs_latest-jsch_latest
# Test leading Python version on current in-repo dev lib versions
py313-sphx_dev-attrs_dev-jsch_dev
# Scan across Sphinx versions (skip 3_x due to a typing import error)
py313-sphx_{1_6_x,1_x,2_x,4_x,5_x,6_x,7_x,8_x,dev}-attrs_latest-jsch_latest
# Scan attrs versions
py313-sphx_latest-attrs_{19_2,19_3,20_3,21_3,22_2,23_2,24_3,dev}-jsch_latest
# Scan jsonschema versions
py313-sphx_latest-attrs_latest-jsch_{3_1_1,3_x,4_0,4_8,4_14,4_20,dev}
# Earliest supported Python and lib versions all together
py310-sphx_1_6_x-attrs_19_2-jsch_3_1_1
# Spot matrix of early Python, Sphinx, attrs versions
py3{10,11}-sphx_{1,2}_x-attrs_{19,20}_2-jsch_latest
# Test the new-earliest jsonschema version that started failing in 3.13
py3{10,11,12,13,14}-sphx_latest-attrs_latest-jsch_3_1_1
# Test the specific Sphinx threshold cases where behavior changed
py313-sphx_{2_3_1,2_4_0,3_2_1,3_3_0,3_4_0,8_1_3,8_2_0}-attrs_latest-jsch_latest
# Simple 'does the sdist install' check
sdist_install
# Lints
flake8
# Sphinx link check
linkcheck
[testenv]
commands=
python --version
python -c 'import sys; print("GIL: ", end=""); print(getattr(sys, "_is_gil_enabled", lambda : True)())'
pip list
# Want the tox *matrix* to ignore warnings since it's primarily
# a compatibility check. The defaults for bare pytest enable -Werror
pytest {posargs:--nonloc -Wignore}
deps=
sphx_1_6_x: sphinx<1.7
sphx_1_x: sphinx<2
sphx_2_x: sphinx<3
sphx_3_x: sphinx<4
sphx_4_x: sphinx<5
sphx_5_x: sphinx<6
sphx_6_x: sphinx<7
sphx_7_x: sphinx<8
sphx_8_x: sphinx<9
sphx_2_3_1: sphinx==2.3.1
sphx_2_4_0: sphinx==2.4.0
sphx_3_2_1: sphinx==3.2.1
sphx_3_3_0: sphinx==3.3.0
sphx_3_4_0: sphinx==3.4.0
sphx_8_1_3: sphinx==8.1.3
sphx_8_2_0: sphinx==8.2.0
sphx_latest: sphinx
sphx_dev: git+https://github.com/sphinx-doc/sphinx
attrs_19_2: attrs==19.2
attrs_19_3: attrs==19.3
attrs_20_3: attrs==20.3
attrs_21_3: attrs==21.3
attrs_22_2: attrs==22.2
attrs_23_2: attrs==23.2
attrs_24_3: attrs==24.3
attrs_latest: attrs
attrs_dev: git+https://github.com/python-attrs/attrs
jsch_3_1_1: jsonschema==3.1.1
jsch_3_x: jsonschema<4
jsch_4_0: jsonschema<4.1
jsch_4_8: jsonschema<4.9
jsch_4_14: jsonschema<4.15
jsch_4_20: jsonschema<4.21
jsch_latest: jsonschema
jsch_dev: git+https://github.com/Julian/jsonschema
dictdiffer
pytest>=4.4.0
pytest-check>=1.1.2
pytest-ordering
pytest-retry
pytest-timeout
stdio-mgr>=1.0.1
sphinx-issues
sphinx-rtd-theme
sphinxcontrib-programoutput
[testenv:linux]
platform=linux
basepython=
py314: python3.14
py314t: python3.14t
py313: python3.13
py313t: python3.13t
py312: python3.12
py311: python3.11
py310: python3.10
[testenv:black]
description=Autoformat code and tests with black
skip_install=True
deps=black
commands=
black --version
black {posargs} .
[testenv:flake8]
description=Lint code and tests with flake8
skip_install=True
deps=-rrequirements-flake8.txt
commands=
flake8 --version
flake8 {posargs} src tests
[testenv:flake8_noqa]
description=Lint noqa directives with flake8-noqa
skip_install=True
deps=-rrequirements-flake8.txt
commands=
pip install flake8-noqa
flake8 --color=never --exit-zero {posargs} tests src
[testenv:interrogate]
description=Lint docstrings with interrogate
skip_install=True
deps=interrogate
commands=
interrogate {posargs} tests src
[testenv:isort]
description=Sort, group, and coalesce imports
skip_install=True
deps=isort
commands=
isort --version
isort {posargs} src tests
[testenv:linkcheck]
description=Run Sphinx linkcheck on docs (Linux only)
platform=linux
skip_install=True
deps=-rrequirements-dev.txt
allowlist_externals=
make
changedir=doc
commands=
make linkcheck
[testenv:sdist_install]
description=Confirm that sdist installs and imports
commands=
python -Werror -c "import sphobjinv"
deps=
[testenv:build]
skip_install=True
description=Build sdist and wheel
deps=
build
twine
commands=
python -m build
twine check dist/*
[pytest]
markers =
local: Tests not requiring Internet access
nonloc: Tests requiring Internet access
cli: Command-line interface tests
api: Direct API tests
textconv: Textconv CLI tests
intersphinx: Tests on intersphinx-related functionality
fixture: Trivial tests for test suite fixtures
testall: Tests that use *all* objects_xyz.inv files in tests/resource, if --testall is specified
first: Inherited marker from `pytest-ordering`
timeout: Inherited marker from `pytest-timeout`
addopts = --strict-markers -rsxX -Werror
norecursedirs = .* env* src *.egg dist build
xfail_strict = True
[flake8]
exclude =
src/sphobjinv/_vendored
# W503: black formats binary operators to start of line
# A005: Submodules are going to be shadowing builtins for the moment
ignore = W503,A005
show_source = True
max_line_length = 88
format = %(cyan)s%(path)s%(reset)s:%(yellow)s%(row)d%(reset)s:%(green)s%(col)d%(reset)s %(red)s(%(code)s)%(reset)s %(text)s
rst-roles =
attr,
class,
data,
doc,
exc,
func,
meth,
mod,
option,
ref,
rst-directives =
doctest,
versionadded,
versionchanged,
per_file_ignores =
# D202: No-space-after-docstring is ugly when the first command is a class/def
# S101: pytest uses asserts liberally
# RST30x: linter can't know about substitutions/references in rst_epilog
src/*: RST305,RST306
tests/*: S101, RST305,RST306
conftest.py: D202, S101, RST305,RST306
# F401: MANY things imported but unused in __init__.py files
src/sphobjinv/__init__.py: F401, RST305,RST306
src/sphobjinv/cli/__init__.py: F401, RST305,RST306
# PIE786: CLI uses 'except Exception:' as a catchall... to be changed, eventually
src/sphobjinv/cli/*: PIE786, RST305,RST306