Skip to content

feat(scripts): [WIP] Add dependency version scanner tool#16867

Draft
chalmerlowe wants to merge 36 commits intomainfrom
feat/add-version-scanner
Draft

feat(scripts): [WIP] Add dependency version scanner tool#16867
chalmerlowe wants to merge 36 commits intomainfrom
feat/add-version-scanner

Conversation

@chalmerlowe
Copy link
Copy Markdown
Contributor

@chalmerlowe chalmerlowe commented Apr 29, 2026

This adds a utility with the ability to scan for common references to dependencies (Python runtimes and package dependencies) to facilitate updating code when runtimes and dependencies change.

  • It can be run against an entire repo OR against specific packages within a monorepo
  • It is customizable with regex patterns and examples here
  • The test suite checks each regex against the examples to ensure the efficacy of the patterns
  • The current patterns account for edge cases such as finding < 3.8 when searching for references to 3.7 since they are semantically equivalent even if syntactically different.
  • The scanner produces a CSV report with:
path/filename, package name, line number, matching pattern, full line for context, etc.

@chalmerlowe chalmerlowe changed the title feat(scripts): Add dependency version scanner tool feat(scripts): [WIP] Add dependency version scanner tool Apr 29, 2026
@chalmerlowe chalmerlowe added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Apr 29, 2026
Copy link
Copy Markdown
Contributor

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

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 introduces a new dependency version scanner, including a configuration-driven regex scanner, a benchmarking tool, and comprehensive unit and integration tests. The review feedback highlights several areas for improvement: optimizing regex compilation in the scanner to avoid performance bottlenecks, using the tempfile module in the benchmark script to prevent race conditions, removing redundant code, improving test robustness by checking subprocess exit codes, and adhering to PEP 8 by moving imports to the top of files.

Comment thread scripts/version_scanner/version_scanner.py Outdated
Comment thread scripts/version_scanner/benchmark.py Outdated
Comment thread scripts/version_scanner/benchmark.py Outdated
Comment thread scripts/version_scanner/tests/integration/test_scanner_integration.py Outdated
Comment thread scripts/version_scanner/tests/unit/test_version_scanner.py Outdated
Comment thread scripts/version_scanner/tests/unit/test_version_scanner.py Outdated
Comment thread scripts/version_scanner/version_scanner.py Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not merge Indicates a pull request not ready for merge, due to either quality or timing.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant