Skip to content

Commit ee18df0

Browse files
committed
Simplify tox config
1 parent 1523e09 commit ee18df0

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

pyproject.toml

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,8 @@ lines-after-imports = 2
242242
[tool.tox]
243243
# https://tox.wiki/en/latest/config.html#pyproject-toml-native
244244
requires = ["tox >= 4"]
245-
env_list = ["py3", "styles", "migrations", "docs"]
245+
# py3 isn't run by default. It's only used for specific tests.
246+
env_list = ["coverage", "styles", "migrations", "docs"]
246247

247248
[tool.tox.env_run_base]
248249
description = "Run the full test suite under {base_python}"
@@ -252,33 +253,30 @@ extras = [
252253
"dev",
253254
]
254255
setenv = { DJANGO_SETTINGS_MODULE = "config.settings.testing", DJANGO_SETTINGS_SKIP_LOCAL = "True" }
256+
257+
[tool.tox.env.py3]
258+
description = "Run specific unit tests without coverage"
259+
commands = [
260+
["uv", "run", "pytest", "{posargs}"],
261+
]
262+
263+
[tool.tox.env.coverage]
264+
description = "Run full unit test suite with coverage"
255265
commands = [
256-
["uv", "run", "coverage", "run", "-m", "pytest", "{posargs}"],
266+
["uv", "run", "coverage", "run", "-m", "pytest"],
257267
["uv", "run", "coverage", "html"],
258268
["uv", "run", "coverage", "report", "--show-missing", "--fail-under=90"],
259269
]
260270

261271
[tool.tox.env.styles]
262272
description = "Run type check on code base"
263-
runner = "uv-venv-lock-runner"
264-
extras = [
265-
"dev",
266-
]
267273
commands = [["uv", "run", "pre-commit", "run", "--all-files"]]
268274

269275
[tool.tox.env.migrations]
270276
description = "Check for missing migrations"
271-
runner = "uv-venv-lock-runner"
272-
extras = [
273-
"dev",
274-
]
275277
commands = [["uv", "run", "python", "manage.py", "makemigrations", "--check", "--dry-run"]]
276278

277279
[tool.tox.env.docs]
278280
description = "Run type check on code base"
279-
runner = "uv-venv-lock-runner"
280281
changedir = "{toxinidir}/docs"
281-
extras = [
282-
"dev",
283-
]
284282
commands = [["uv", "run", "sphinx-build", "-W", "--keep-going", "-b", "html", "-d", "{envtmpdir}/doctrees", ".", "{envtmpdir}/html"]]

0 commit comments

Comments
 (0)