feat(version-scanner): refine python version checks and document boundary logic#17477
Open
chalmerlowe wants to merge 2 commits into
Open
feat(version-scanner): refine python version checks and document boundary logic#17477chalmerlowe wants to merge 2 commits into
chalmerlowe wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the version scanner regex configurations to support optional patch versions in python_requires, adds rules for matching sys.version_info[1], and introduces a new dependency_requirement rule group. It also cleans up unused imports in tests and updates test validation to dynamically resolve dependency names. The review feedback highlights several opportunities to make the regex patterns more robust: restricting optional patch versions on boundary rules to (?:\.0)? to avoid false positives, adding a negative lookahead (?!\d) to the dependency requirement pattern to prevent partial version matches, and allowing optional whitespace inside the brackets for sys.version_info[1].
…ow subscript whitespace
f05363d to
0c03af1
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.
This pull request refines the regex rules configuration used by the dependency version scanner. It improves Python runtime version boundary checking and documents the intent behind boundary offsets.
Key changes:
python_requireschecks to support optional patch versions (e.g., matching>=3.7.0).sys.version_info[1] >= 7).+1and-1offset logic for external reviewers and auditors.