@@ -49,6 +49,13 @@ classifiers = [
4949"Documentation" = " https://python-hyper.org/"
5050
5151[dependency-groups ]
52+ dev = [
53+ { include-group = " testing" },
54+ { include-group = " linting" },
55+ { include-group = " packaging" },
56+ { include-group = " docs" },
57+ ]
58+
5259testing = [
5360 " pytest>=8.3.3,<9" ,
5461 " pytest-cov>=6.0.0,<7" ,
@@ -109,3 +116,89 @@ source = [
109116 " src/" ,
110117 " .tox/**/site-packages/" ,
111118]
119+
120+ [tool .tox ]
121+ min_version = " 4.23.2"
122+ env_list = [ " py39" , " py310" , " py311" , " py312" , " py313" , " pypy3" , " lint" , " docs" , " packaging" ]
123+
124+ [tool .tox .gh-actions ]
125+ python = """
126+ 3.9: py39, h2spec, lint, docs, packaging
127+ 3.10: py310
128+ 3.11: py311
129+ 3.12: py312
130+ 3.13: py313
131+ pypy3: pypy3
132+ """
133+
134+ [tool .tox .env_run_base ]
135+ pass_env = [
136+ " GITHUB_*" ,
137+ ]
138+ dependency_groups = [" testing" ]
139+ commands = [
140+ [" python" , " -bb" , " -m" , " pytest" , " --cov-report=xml" , " --cov-report=term" , " --cov=h2" , { replace = " posargs" , extend = true }]
141+ ]
142+
143+ [tool .tox .env .pypy3 ]
144+ # temporarily disable coverage testing on PyPy due to performance problems
145+ commands = [
146+ [" pytest" , { replace = " posargs" , extend = true }]
147+ ]
148+
149+ [tool .tox .env .lint ]
150+ dependency_groups = [" linting" ]
151+ commands = [
152+ [" ruff" , " check" , " src/" ],
153+ # TODO: ["mypy", "src/"],
154+ ]
155+
156+ [tool .tox .env .docs ]
157+ dependency_groups = [" docs" ]
158+ allowlist_externals = [" make" ]
159+ changedir = " {toxinidir}/docs"
160+ commands = [
161+ [" make" , " clean" ],
162+ [" make" , " html" ],
163+ ]
164+
165+ [tool .tox .env .packaging ]
166+ base_python = [" python39" ]
167+ dependency_groups = [" packaging" ]
168+ allowlist_externals = [" rm" ]
169+ commands = [
170+ [" rm" , " -rf" , " dist/" ],
171+ [" check-manifest" ],
172+ [" python" , " -m" , " build" , " --outdir" , " dist/" ],
173+ [" twine" , " check" , " dist/*" ],
174+ ]
175+
176+ [tool .tox .env .publish ]
177+ base_python = " {[tool.tox.env.packaging]base_python}"
178+ deps = " {[tool.tox.env.packaging]deps}"
179+ allowlist_externals = " {[tool.tox.env.packaging]allowlist_externals}"
180+ commands = [
181+ " {[testenv:packaging]commands}" ,
182+ [" twine" , " upload" , " dist/*" ],
183+ ]
184+
185+ [tool .tox .env .graphs ]
186+ basepython = [" python3.9" ]
187+ deps = [
188+ " graphviz==0.14.1" ,
189+ ]
190+ commands = [
191+ [" python" , " visualizer/visualize.py" , " -i" , " docs/source/_static" ],
192+ ]
193+
194+ [tool .tox .env .h2spec ]
195+ basepython = [" python3.9" ]
196+ deps = [
197+ " twisted[tls]==20.3.0" ,
198+ ]
199+ allowlist_externals = [
200+ " {toxinidir}/tests/h2spectest.sh"
201+ ]
202+ commands = [
203+ [" {toxinidir}/tests/h2spectest.sh" ],
204+ ]
0 commit comments