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 06993da commit 2595cf6
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 60 deletions.
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ graft tests
prune docs/build
prune tests/http2-frame-test-case

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

global-exclude *.pyc *.pyo *.swo *.swp *.map *.yml *.DS_Store
74 changes: 73 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 = "hyperframe"
description = "HTTP/2 framing layer for Python"
description = "Pure-Python HTTP/2 framing"
readme = { file = "README.rst", content-type = "text/x-rst" }
license = { file = "LICENSE" }

Expand Down Expand Up @@ -46,6 +46,13 @@ 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 @@ -105,3 +112,68 @@ 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=hyperframe", { 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/*"],
]
58 changes: 0 additions & 58 deletions tox.ini

This file was deleted.

0 comments on commit 2595cf6

Please sign in to comment.