🐛 fix(config): resolve overrides with alias config keys - #3736
Merged
Conversation
gaborbernat
force-pushed
the
fix-override-alias-keys
branch
from
February 17, 2026 22:05
9af2967 to
fb4df29
Compare
When using TOX_OVERRIDE with += (append) and the override key differs from the config file key (e.g., pass_env vs passenv), the config value was lost. Now Loader.load() checks all alias keys for both raw config values and overrides. Fixes tox-dev#3127, fixes tox-dev#3348.
gaborbernat
force-pushed
the
fix-override-alias-keys
branch
from
February 17, 2026 22:07
fb4df29 to
cec3722
Compare
gaborbernat
enabled auto-merge (squash)
February 17, 2026 22:08
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.
Many tox configuration keys have aliases for backward compatibility (e.g.,
pass_env/passenv,set_env/setenv,env_list/envlist). When usingTOX_OVERRIDEwith the append operator (+=) and the override key name differed from what was used in the config file, tox would silently drop either the config value or the override value. For example,TOX_OVERRIDE=testenv.pass_env+=BARwould loseFOOif the ini file usedpassenv = FOO, and vice versa. 🐛 This has been a pain point for projects relying on CI-level overrides to extend environment variables.The root cause was in how config loading iterated over alias keys independently. The loader tried each key name separately with each config source, and would stop on the first key that produced any result — even if that result was only from the override, missing the raw config value stored under the alias. The fix consolidates alias resolution:
Loader.load()now receives all alias keys upfront, collects overrides from any of them, and tries loading the raw value from all aliases before applying overrides.Fixes #3127, fixes #3348.