1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
|
requires = [ "tox>=4.45" ]
env_list = [
"3.14",
"3.13",
"3.12",
"3.11",
"3.10",
"3.9",
"3.8",
"pypy3",
"3.13t",
"3.14t",
"coverage",
"docs",
"fix",
"graalpy",
"readme",
"rp",
"type",
]
skip_missing_interpreters = true
[env_run_base]
description = "run tests with {env_name}"
package = "wheel"
wheel_build_env = ".pkg"
dependency_groups = [ "test" ]
pass_env = [ "CI_RUN", "PYTEST_*", "TERM" ]
set_env._COVERAGE_SRC = "{env_site_packages_dir}{/}virtualenv"
set_env.COVERAGE_FILE = "{work_dir}{/}.coverage.{env_name}"
set_env.COVERAGE_PROCESS_START = "{tox_root}{/}pyproject.toml"
set_env.PYTHONWARNDEFAULTENCODING = "1"
commands = [
[ "coverage", "erase" ],
[
"coverage",
"run",
"-m",
"pytest",
{ replace = "posargs", extend = true, default = [
"--junitxml",
"{work_dir}{/}junit.{env_name}.xml",
"tests",
"--int",
"-n",
"auto",
"--dist",
"loadfile",
] },
],
[ "coverage", "combine" ],
[ "coverage", "report", "--skip-covered", "--show-missing" ],
[ "coverage", "xml", "-o", "{work_dir}{/}coverage.{env_name}.xml" ],
[
"coverage",
"html",
"-d",
"{env_tmp_dir}{/}htmlcov",
"--show-contexts",
"--title",
"virtualenv-{env_name}-coverage",
],
]
uv_seed = true
[env.docs]
description = "build documentation"
dependency_groups = [ "docs" ]
set_env.PYTHONUTF8 = "1"
commands = [
[ "pre-commit", "run", "docstrfmt", "--all-files" ],
[ "proselint", "check", "docs" ],
[
"sphinx-build",
"-d",
"{env_tmp_dir}{/}doctree",
"docs",
"{env:READTHEDOCS_OUTPUT:{env_tmp_dir}{/}docs_out}/html",
"--color",
"-b",
"html",
"-W",
],
[
"python",
"-c",
"""\
import pathlib; print(\"documentation available under file://\" + str(pathlib.Path(r\"{work_dir}\") / \"docs_out\" / \
\"index.html\"))\
""",
],
]
[env.fix]
description = "format the code base to adhere to our styles, and complain about what we cannot do automatically"
skip_install = true
dependency_groups = [ "lint" ]
commands = [ [ "pre-commit", "run", "--all-files", "--show-diff-on-failure" ] ]
[env.graalpy]
commands = [
[
"pytest",
{ replace = "posargs", extend = true, default = [
"--junitxml",
"{work_dir}{/}junit.{env_name}.xml",
"tests",
"--skip-slow",
] },
],
]
[env.readme]
description = "check that the long description is valid"
skip_install = true
dependency_groups = [ "pkg-meta" ]
commands = [
[ "uv", "build", "--sdist", "--wheel", "--out-dir", "{env_tmp_dir}", "." ],
[ "twine", "check", "{env_tmp_dir}{/}*" ],
[ "check-wheel-contents", "--no-config", "{env_tmp_dir}" ],
]
[env.rp]
commands = [
[
"pytest",
{ replace = "posargs", extend = true, default = [
"--junitxml",
"{work_dir}{/}junit.{env_name}.xml",
"tests",
"--skip-slow",
] },
],
]
[env.type]
description = "run type checker (ty) against Python 3.14"
dependency_groups = [ "type" ]
commands = [ [ "python", "-m", "ty", "check", "src/virtualenv", "--python-version", "3.14" ] ]
[env.upgrade]
description = "upgrade pip/wheels/setuptools to latest"
skip_install = true
deps = [ "ruff>=0.12.4" ]
pass_env = [ "UPGRADE_ADVISORY" ]
change_dir = "{tox_root}{/}tasks"
commands = [ [ "python", "upgrade_wheels.py" ] ]
uv_seed = true
[env.release]
description = "do a release, required posarg of the version number"
deps = [ "gitpython>=3.1.44", "packaging>=25", "pre-commit-uv>=4.1.4", "towncrier>=24.8" ]
change_dir = "{tox_root}{/}tasks"
commands = [ [ "python", "release.py", { replace = "posargs", extend = true } ] ]
[env.dev]
description = "generate a DEV environment"
package = "editable"
dependency_groups = [ "dev" ]
commands = [
[ "uv", "pip", "tree" ],
[ "python", "-c", "import sys; print(sys.executable)" ],
]
[env.zipapp]
description = "generate a zipapp"
skip_install = true
deps = [ "packaging>=25" ]
commands = [ [ "python", "tasks/make_zipapp.py" ] ]
uv_seed = true
[env."type-3.8"]
description = "run type checker (ty) against Python 3.8"
commands = [ [ "python", "-m", "ty", "check", "src/virtualenv", "--python-version", "3.8" ] ]
base = [ "type" ]
|