Skip to content

Commit ae788d9

Browse files
committed
migrate tox.ini into pyproject.toml
1 parent 96f12a3 commit ae788d9

File tree

3 files changed

+88
-73
lines changed

3 files changed

+88
-73
lines changed

MANIFEST.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ exclude tasks.py
1010
exclude tests/test_fixtures/*/*.json
1111
exclude tests/test_hpack_integration.py
1212

13-
include README.rst LICENSE CHANGELOG.rst CONTRIBUTORS.rst pyproject.toml tox.ini
13+
include README.rst LICENSE CHANGELOG.rst CONTRIBUTORS.rst pyproject.toml
1414

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

pyproject.toml

+87-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
77

88
[project]
99
name = "hpack"
10-
description = "Pure-Python HPACK header compression"
10+
description = "Pure-Python HPACK header encoding"
1111
readme = { file = "README.rst", content-type = "text/x-rst" }
1212
license = { file = "LICENSE" }
1313

@@ -46,6 +46,12 @@ classifiers = [
4646
"Documentation" = "https://python-hyper.org/"
4747

4848
[dependency-groups]
49+
dev = [
50+
{ include-group = "testing" },
51+
{ include-group = "linting" },
52+
{ include-group = "packaging" },
53+
{ include-group = "docs" },
54+
]
4955
testing = [
5056
"pytest>=8.3.3,<9",
5157
"pytest-cov>=6.0.0,<7",
@@ -103,3 +109,83 @@ source = [
103109
"src/",
104110
".tox/**/site-packages/",
105111
]
112+
113+
[tool.tox]
114+
min_version = "4.23.2"
115+
env_list = [ "py39", "py310", "py311", "py312", "py313", "pypy3", "lint", "docs", "packaging" ]
116+
117+
[tool.tox.gh-actions]
118+
python = """
119+
3.9: py39, h2spec, lint, docs, packaging
120+
3.10: py310
121+
3.11: py311
122+
3.12: py312
123+
3.13: py313
124+
pypy3: pypy3
125+
"""
126+
127+
[tool.tox.env_run_base]
128+
pass_env = [
129+
"GITHUB_*",
130+
]
131+
dependency_groups = ["testing"]
132+
commands = [
133+
["pytest", "--cov-report=xml", "--cov-report=term", "--cov=hpack", { replace = "posargs", extend = true }]
134+
]
135+
136+
[tool.tox.env.pypy3]
137+
# temporarily disable coverage testing on PyPy due to performance problems
138+
commands = [
139+
["pytest", { replace = "posargs", extend = true }]
140+
]
141+
142+
[tool.tox.env.lint]
143+
dependency_groups = ["linting"]
144+
commands = [
145+
["ruff", "check", "src/"],
146+
["mypy", "src/"],
147+
]
148+
149+
[tool.tox.env.docs]
150+
dependency_groups = ["docs"]
151+
allowlist_externals = ["make"]
152+
changedir = "{toxinidir}/docs"
153+
commands = [
154+
["make", "clean"],
155+
["make", "html"],
156+
]
157+
158+
[tool.tox.env.packaging]
159+
base_python = ["python39"]
160+
dependency_groups = ["packaging"]
161+
allowlist_externals = ["rm"]
162+
commands = [
163+
["rm", "-rf", "dist/"],
164+
["check-manifest"],
165+
["python", "-m", "build", "--outdir", "dist/"],
166+
["twine", "check", "dist/*"],
167+
]
168+
169+
[tool.tox.env.publish]
170+
base_python = "{[tool.tox.env.packaging]base_python}"
171+
deps = "{[tool.tox.env.packaging]deps}"
172+
allowlist_externals = "{[tool.tox.env.packaging]allowlist_externals}"
173+
commands = [
174+
"{[testenv:packaging]commands}",
175+
["twine", "upload", "dist/*"],
176+
]
177+
178+
[tool.tox.env.bench]
179+
deps = [
180+
"{[tool.tox.env]deps}",
181+
"pytest-benchmark==3.2.3",
182+
]
183+
commands = [
184+
["pytest {toxinidir}/bench/ --benchmark-only --benchmark-group-by=name --benchmark-autosave --benchmark-compare --benchmark-min-rounds=500000"],
185+
]
186+
187+
[tool.tox.env.create_test_output]
188+
base_python = ["python3.9"]
189+
commands = [
190+
["python", "{toxinidir}/utils/create_test_output.py", { replace = "posargs", extend = true }],
191+
]

tox.ini

-71
This file was deleted.

0 commit comments

Comments
 (0)