Skip to content

feat(version-scanner): refine python version checks and document boundary logic#17477

Open
chalmerlowe wants to merge 2 commits into
mainfrom
feat/version-scanner-regex
Open

feat(version-scanner): refine python version checks and document boundary logic#17477
chalmerlowe wants to merge 2 commits into
mainfrom
feat/version-scanner-regex

Conversation

@chalmerlowe

Copy link
Copy Markdown
Contributor

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:

  • Refines python_requires checks to support optional patch versions (e.g., matching >=3.7.0).
  • Adds subscript-based minor version checks (e.g., sys.version_info[1] >= 7).
  • Adds inline YAML comments to document the +1 and -1 offset logic for external reviewers and auditors.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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].

Comment thread scripts/version_scanner/regex_config.yaml Outdated
Comment thread scripts/version_scanner/regex_config.yaml Outdated
Comment thread scripts/version_scanner/regex_config.yaml Outdated
@chalmerlowe chalmerlowe reopened this Jun 16, 2026
@chalmerlowe chalmerlowe force-pushed the feat/version-scanner-regex branch from f05363d to 0c03af1 Compare June 16, 2026 15:34
@chalmerlowe chalmerlowe marked this pull request as ready for review June 16, 2026 15:50
@chalmerlowe chalmerlowe requested a review from a team as a code owner June 16, 2026 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant