🐛 fix(config): allow glob patterns in ini depends#3825
Merged
gaborbernat merged 2 commits intotox-dev:mainfrom Feb 25, 2026
Merged
🐛 fix(config): allow glob patterns in ini depends#3825gaborbernat merged 2 commits intotox-dev:mainfrom
gaborbernat merged 2 commits intotox-dev:mainfrom
Conversation
The _FACTOR_RE regex rejected * and ? characters, causing glob patterns like `depends = 3.*` to crash when used in tox.ini files. TOML worked because it bypasses factor expansion entirely. Adding glob wildcards to the factor regex lets patterns pass through to the downstream fnmatchcase matching that already handles them correctly. Also converts all static regexes project-wide to verbose format and extracts the duplicated unescaped-space pattern in req_file.py into a shared compiled constant. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Glob patterns like
depends = 3.*intox.inifiles crash because the ini loader's factor expansion rejects*and?characters via_FACTOR_RE. 🐛 The same patterns work fine intox.tomlbecause the TOML loader createsEnvListdirectly from string values, bypassing factor expansion entirely. This is tracked in #3822.The fix adds glob wildcard characters to
_FACTOR_RE's character classes so patterns pass through factor expansion unchanged. The actual glob matching is already handled downstream byfnmatchcaseinrun_order, so no additional matching logic is needed.✨ All static regex patterns across the codebase have also been converted to verbose format (
re.VERBOSE) for readability, and a duplicated inlinere.subpattern inreq_file.pyhas been extracted into a shared compiled constant.Fixes #3822