Skip to content

🐛 fix(config): prevent env_run_base deps from being clobbered#3721

Merged
gaborbernat merged 2 commits intotox-dev:mainfrom
gaborbernat:fix-3393-env-run-base-deps-clobber
Feb 17, 2026
Merged

🐛 fix(config): prevent env_run_base deps from being clobbered#3721
gaborbernat merged 2 commits intotox-dev:mainfrom
gaborbernat:fix-3393-env-run-base-deps-clobber

Conversation

@gaborbernat
Copy link
Member

When users configure TOML environments with deps = ["{[tool.tox.env_run_base]deps}", "extra-dep"], the additional dependencies were silently dropped and only the base section deps were installed. This breaks a natural pattern for extending base configurations, making it impossible to share common dependencies across environments while adding environment-specific ones. 🔧

The configuration reference expansion logic incorrectly treated env_run_base and env_pkg_base as regular test environments because their section names start with the environment prefix tool.tox.env. This caused the system to attempt creating a virtual environment named run_base instead of reading the raw configuration values, breaking the reference expansion and silently discarding any additional dependencies in the list.

The fix adds an explicit check to exclude these special base sections from environment resolution, ensuring they're always treated as raw configuration sections. This preserves the intended behavior where base sections can be referenced alongside additional values without data loss. ✨

Closes #3393

…ed as environments

When users referenced env_run_base or env_pkg_base sections in TOML config
using the syntax deps = ["{[tool.tox.env_run_base]deps}", "extra-dep"], the
reference expansion logic incorrectly treated these special base sections as
regular test environments. This caused the configuration system to create a
virtual environment named "run_base" instead of reading the raw configuration
values, resulting in additional dependencies being silently dropped.

The bug occurred because the section name "tool.tox.env_run_base" starts with
the environment prefix "tool.tox.env", triggering environment lookup logic
that should only apply to actual test environments like "tool.tox.env.py311".

Fixed by explicitly checking if the section matches the exact names of the
special base sections (env_run_base and env_pkg_base) before attempting
environment resolution, ensuring these are always treated as raw configuration
sections rather than environment references.
@gaborbernat gaborbernat enabled auto-merge (squash) February 17, 2026 06:43
@gaborbernat gaborbernat merged commit 0ee48ce into tox-dev:main Feb 17, 2026
28 checks passed
@gaborbernat gaborbernat deleted the fix-3393-env-run-base-deps-clobber branch February 18, 2026 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unclear how to use configuration reference in TOML config

1 participant