Skip to content

Commit a4ca4db

Browse files
committed
migrate tox.ini into pyproject.toml
1 parent b0485e9 commit a4ca4db

File tree

3 files changed

+94
-72
lines changed

3 files changed

+94
-72
lines changed

MANIFEST.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ prune docs/build
88

99
recursive-include examples *.py *.crt *.key *.pem *.csr
1010

11-
include README.rst LICENSE CHANGELOG.rst tox.ini
11+
include README.rst LICENSE CHANGELOG.rst pyproject.toml
1212

1313
global-exclude *.pyc *.pyo *.swo *.swp *.map *.yml *.DS_Store

pyproject.toml

+93
Original file line numberDiff line numberDiff line change
@@ -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+
5259
testing = [
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+
["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+
]

tox.ini

-71
This file was deleted.

0 commit comments

Comments
 (0)