Skip to content

Commit

Permalink
migrate tox.ini into pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
Kriechi committed Dec 20, 2024
1 parent 96f12a3 commit ae788d9
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 73 deletions.
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ exclude tasks.py
exclude tests/test_fixtures/*/*.json
exclude tests/test_hpack_integration.py

include README.rst LICENSE CHANGELOG.rst CONTRIBUTORS.rst pyproject.toml tox.ini
include README.rst LICENSE CHANGELOG.rst CONTRIBUTORS.rst pyproject.toml

global-exclude *.pyc *.pyo *.swo *.swp *.map *.yml *.DS_Store
88 changes: 87 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"

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

Expand Down Expand Up @@ -46,6 +46,12 @@ classifiers = [
"Documentation" = "https://python-hyper.org/"

[dependency-groups]
dev = [
{ include-group = "testing" },
{ include-group = "linting" },
{ include-group = "packaging" },
{ include-group = "docs" },
]
testing = [
"pytest>=8.3.3,<9",
"pytest-cov>=6.0.0,<7",
Expand Down Expand Up @@ -103,3 +109,83 @@ source = [
"src/",
".tox/**/site-packages/",
]

[tool.tox]
min_version = "4.23.2"
env_list = [ "py39", "py310", "py311", "py312", "py313", "pypy3", "lint", "docs", "packaging" ]

[tool.tox.gh-actions]
python = """
3.9: py39, h2spec, lint, docs, packaging
3.10: py310
3.11: py311
3.12: py312
3.13: py313
pypy3: pypy3
"""

[tool.tox.env_run_base]
pass_env = [
"GITHUB_*",
]
dependency_groups = ["testing"]
commands = [
["pytest", "--cov-report=xml", "--cov-report=term", "--cov=hpack", { replace = "posargs", extend = true }]
]

[tool.tox.env.pypy3]
# temporarily disable coverage testing on PyPy due to performance problems
commands = [
["pytest", { replace = "posargs", extend = true }]
]

[tool.tox.env.lint]
dependency_groups = ["linting"]
commands = [
["ruff", "check", "src/"],
["mypy", "src/"],
]

[tool.tox.env.docs]
dependency_groups = ["docs"]
allowlist_externals = ["make"]
changedir = "{toxinidir}/docs"
commands = [
["make", "clean"],
["make", "html"],
]

[tool.tox.env.packaging]
base_python = ["python39"]
dependency_groups = ["packaging"]
allowlist_externals = ["rm"]
commands = [
["rm", "-rf", "dist/"],
["check-manifest"],
["python", "-m", "build", "--outdir", "dist/"],
["twine", "check", "dist/*"],
]

[tool.tox.env.publish]
base_python = "{[tool.tox.env.packaging]base_python}"
deps = "{[tool.tox.env.packaging]deps}"
allowlist_externals = "{[tool.tox.env.packaging]allowlist_externals}"
commands = [
"{[testenv:packaging]commands}",
["twine", "upload", "dist/*"],
]

[tool.tox.env.bench]
deps = [
"{[tool.tox.env]deps}",
"pytest-benchmark==3.2.3",
]
commands = [
["pytest {toxinidir}/bench/ --benchmark-only --benchmark-group-by=name --benchmark-autosave --benchmark-compare --benchmark-min-rounds=500000"],
]

[tool.tox.env.create_test_output]
base_python = ["python3.9"]
commands = [
["python", "{toxinidir}/utils/create_test_output.py", { replace = "posargs", extend = true }],
]
71 changes: 0 additions & 71 deletions tox.ini

This file was deleted.

0 comments on commit ae788d9

Please sign in to comment.