Skip to content

🐛 fix(env): restore compound factor conditionals#3782

Merged
gaborbernat merged 1 commit intotox-dev:mainfrom
gaborbernat:fix/factor-conditionals-3780
Feb 20, 2026
Merged

🐛 fix(env): restore compound factor conditionals#3782
gaborbernat merged 1 commit intotox-dev:mainfrom
gaborbernat:fix/factor-conditionals-3780

Conversation

@gaborbernat
Copy link
Copy Markdown
Member

PR #3753 fixed section header names from being decomposed into freely combinable factors, preventing tox -e functional-py312 from silently falling back to [testenv] when only [testenv:functional{-py310}] was defined. However, it also broke compound factor conditionals like np-cov: coverage — running tox -e py310-np-cov would fail with "provided environments not found" because the individual factor cov (from the compound conditional np-cov) was no longer recognized as combinable.

🔍 The fix distinguishes between env names from section headers and env names discovered from factor conditionals. Section header names remain valid only as whole identifiers (preserving the #3753 fix), while factor-conditional env names have their individual factors added to the combinable set. This is done by collecting section-derived env names via Config.sections() and treating everything else in known_envs (minus env_list) as factor-conditional — splitting those into individual factors.

Fixes #3780

@gaborbernat gaborbernat added the bug:minor does not affect many people or has no big impact label Feb 20, 2026
PR tox-dev#3753 restricted env name validation to prevent section header names
from being split into freely combinable factors. However, it also
prevented factor-conditional-discovered env names (like `np-cov` from
`np-cov: coverage`) from contributing their individual factors. This
caused `tox -e py310-np-cov` to fail with "provided environments not
found" when compound factor conditionals were used in the config.

The fix distinguishes between section header env names (kept as whole
identifiers) and factor-conditional env names (split into individual
combinable factors), restoring the expected behavior.

Fixes tox-dev#3780
@gaborbernat gaborbernat force-pushed the fix/factor-conditionals-3780 branch from b60fa61 to b1fb584 Compare February 20, 2026 00:34
@gaborbernat gaborbernat enabled auto-merge (squash) February 20, 2026 00:37
@gaborbernat gaborbernat disabled auto-merge February 20, 2026 00:41
@gaborbernat gaborbernat enabled auto-merge (squash) February 20, 2026 00:41
@gaborbernat gaborbernat merged commit e652010 into tox-dev:main Feb 20, 2026
28 checks passed
@gaborbernat gaborbernat deleted the fix/factor-conditionals-3780 branch February 20, 2026 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:chronographer:provided bug:minor does not affect many people or has no big impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Factor conditionals no longer accepted

1 participant