✨ feat(config): add default_base_python config key#3783
Merged
gaborbernat merged 1 commit intotox-dev:mainfrom Feb 20, 2026
Merged
✨ feat(config): add default_base_python config key#3783gaborbernat merged 1 commit intotox-dev:mainfrom
gaborbernat merged 1 commit intotox-dev:mainfrom
Conversation
Environments without a Python factor or explicit base_python now consult default_base_python before falling back to sys.executable. This lets projects pin a fallback interpreter for reproducibility without conflicting with pyXY factor-named environments.
c96f589 to
e5101d1
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.
Environments without a Python factor in their name (e.g.
lint,type,docs) currently fall back tosys.executablewhenbase_pythonisn't explicitly set. This means the interpreter varies across machines — Ubuntu 22.04 defaults to 3.10, Fedora 37 to 3.11 — harming reproducibility and causing unexpected failures when dependencies don't support the host's Python version. 🔧 Settingbase_pythonglobally in[env_run_base]works around this but conflicts withpyXYfactor-named environments.The new
default_base_pythonkey sits at the environment config level and acts as a fallback only when no Python factor is detected and no explicitbase_pythonis set. This gives it clear precedence semantics: Python factor > explicitbase_python>default_base_python>sys.executable. Placing it in[env_run_base]rather than[tox]allows per-environment overrides when needed.✨ Existing configurations are unaffected since the default remains
sys.executable. This closes #2846.