🐛 fix(env): restore compound factor conditionals#3782
Merged
gaborbernat merged 1 commit intotox-dev:mainfrom Feb 20, 2026
Merged
🐛 fix(env): restore compound factor conditionals#3782gaborbernat merged 1 commit intotox-dev:mainfrom
gaborbernat merged 1 commit intotox-dev:mainfrom
Conversation
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
b60fa61 to
b1fb584
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR #3753 fixed section header names from being decomposed into freely combinable factors, preventing
tox -e functional-py312from silently falling back to[testenv]when only[testenv:functional{-py310}]was defined. However, it also broke compound factor conditionals likenp-cov: coverage— runningtox -e py310-np-covwould fail with "provided environments not found" because the individual factorcov(from the compound conditionalnp-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 inknown_envs(minusenv_list) as factor-conditional — splitting those into individual factors.Fixes #3780