Skip to content

Commit d4a5c41

Browse files
committed
Clarify the factor-conditional dependency_groups comment in tox.ini
1 parent c40eba2 commit d4a5c41

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

tox.ini

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,16 @@ passenv =
2828
GITHUB_*
2929
PYTEST_*
3030
parallel_show_output = true
31-
# Only install the `tests` dependency group for the test and coverage
32-
# envs (other envs inheriting from this section, such as `build-dists`
33-
# and `pre-commit-*`, define their own dependencies)
31+
# Install the `tests` dependency group (from pyproject.toml), but only in
32+
# the envs that run tests or coverage. The `pytest,tests,coverage:` prefix
33+
# is tox's factor-conditional syntax (also used in `commands` below): the
34+
# value after the colon only applies to envs matching one of these factors,
35+
# i.e. `pytest`, `tests-{unit,e2e,cicd_utils}`, and `coverage-combine`.
36+
# Without this guard, envs that inherit from this section but don't override
37+
# this key (e.g. `build-dists` and `pre-commit-*`) would also install the
38+
# test dependencies. NOTE: the `tests` factor (left of the colon) and the
39+
# `tests` dependency group (right of the colon) are different things that
40+
# just happen to share a name.
3441
dependency_groups =
3542
pytest,tests,coverage: tests
3643
allowlist_externals = rm, mv

0 commit comments

Comments
 (0)