Skip to content

Commit 0ab50f1

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

File tree

3 files changed

+92
-72
lines changed

3 files changed

+92
-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

+91
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,87 @@ 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.python]
125+
"3.9" = [ "py39", "h2spec", "lint", "docs", "packaging" ]
126+
"3.10" = [ "py310" ]
127+
"3.11" = [ "py311" ]
128+
"3.12" = [ "py312" ]
129+
"3.13" = [ "py313" ]
130+
"pypy3" = [ "pypy3" ]
131+
132+
[tool.tox.env_run_base]
133+
pass_env = [
134+
"GITHUB_*",
135+
]
136+
dependency_groups = ["testing"]
137+
commands = [
138+
["python", "-bb", "-m", "pytest", "--cov-report=xml", "--cov-report=term", "--cov=h2", { replace = "posargs", extend = true }]
139+
]
140+
141+
[tool.tox.env.pypy3]
142+
# temporarily disable coverage testing on PyPy due to performance problems
143+
commands = [
144+
["pytest", { replace = "posargs", extend = true }]
145+
]
146+
147+
[tool.tox.env.lint]
148+
dependency_groups = ["linting"]
149+
commands = [
150+
["ruff", "check", "src/"],
151+
["mypy", "src/"],
152+
]
153+
154+
[tool.tox.env.docs]
155+
dependency_groups = ["docs"]
156+
allowlist_externals = ["make"]
157+
changedir = "{toxinidir}/docs"
158+
commands = [
159+
["make", "clean"],
160+
["make", "html"],
161+
]
162+
163+
[tool.tox.env.packaging]
164+
base_python = ["python39"]
165+
dependency_groups = ["packaging"]
166+
allowlist_externals = ["rm"]
167+
commands = [
168+
["rm", "-rf", "dist/"],
169+
["check-manifest"],
170+
["python", "-m", "build", "--outdir", "dist/"],
171+
["twine", "check", "dist/*"],
172+
]
173+
174+
[tool.tox.env.publish]
175+
base_python = "{[tool.tox.env.packaging]base_python}"
176+
deps = "{[tool.tox.env.packaging]deps}"
177+
allowlist_externals = "{[tool.tox.env.packaging]allowlist_externals}"
178+
commands = [
179+
"{[testenv:packaging]commands}",
180+
["twine", "upload", "dist/*"],
181+
]
182+
183+
[tool.tox.env.graphs]
184+
basepython = ["python3.9"]
185+
deps = [
186+
"graphviz==0.14.1",
187+
]
188+
commands = [
189+
["python", "visualizer/visualize.py", "-i", "docs/source/_static"],
190+
]
191+
192+
[tool.tox.env.h2spec]
193+
basepython = ["python3.9"]
194+
deps = [
195+
"twisted[tls]==20.3.0",
196+
]
197+
allowlist_externals = [
198+
"{toxinidir}/tests/h2spectest.sh"
199+
]
200+
commands = [
201+
["{toxinidir}/tests/h2spectest.sh"],
202+
]

tox.ini

-71
This file was deleted.

0 commit comments

Comments
 (0)