Skip to content

Commit a7907a9

Browse files
committed
docs(version_scanner): update README with setup, scope, limitations, and package-file details
1 parent 919ae7e commit a7907a9

2 files changed

Lines changed: 21 additions & 1 deletion

File tree

scripts/version_scanner/README.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,31 @@ python3 scripts/version_scanner/version_scanner.py -d <dependency> -v <version>
1616
* `-v`, `--version`: Specific version to search for (e.g., 3.7, 4.25.8)
1717
* `-p`, `--path`: Root directory to scan (defaults to current directory)
1818
* `--package`: Specific subdirectory filter (useful for monorepos)
19-
* `--package-file`: Path to a file containing a list of package directories to scan
19+
* `--package-file`: Path to a file containing a list of package directories to scan (e.g., `scripts/version_scanner/small_package_list.txt`)
2020
* `--config`: Path to the regex configuration file (defaults to scripts/version_scanner/regex_config.yaml)
2121
* `-o`, `--output`: Path to the output CSV file (defaults to <dependency>-<version>-<timestamp>.csv)
2222
* `--github-repo`: GitHub repository URL base (defaults to https://github.com/googleapis/google-cloud-python)
2323
* `--branch`: GitHub branch for links (defaults to main)
2424

25+
## Installation & Setup
26+
27+
By default, the core scanner only depends on Python's standard library and **`pyyaml`** to read the configuration file.
28+
29+
If you want to use the Google Drive upload feature (`--upload`), you must install the optional Google API client dependencies:
30+
```bash
31+
pip install -r scripts/version_scanner/requirements.txt
32+
```
33+
34+
## Scope: Handwritten vs. Generated Code
35+
36+
> [!NOTE]
37+
> **This scanner is primarily intended for auditing handwritten code, configuration files, CI scripts, and documentation.**
38+
> You do **not** need to scan or manually edit auto-generated GAPIC libraries. Any dependency updates for generated code are handled upstream by editing the generator templates in the `gapic-generator-python` repository. When the templates are updated, the changes naturally trickle downstream to correct all generated client libraries upon the next regeneration.
39+
40+
## Limitations
41+
42+
* **Single-Line Matching Only**: The scanner processes files line-by-line to ensure high performance and simplicity. Consequently, version declarations or dependency lists that span across multiple lines (such as multiline lists in a `setup.py` file) will not be caught by the regex patterns.
43+
2544
## Configuration
2645

2746
The scanner uses a YAML configuration file (`regex_config.yaml`) to define rules and regex patterns.

scripts/version_scanner/small_package_list.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Example package list for filtering scanning targets via the --package-file option.
12
packages/google-cloud-access-context-manager
23
packages/google-cloud-bigtable
34
packages/google-cloud-biglake-hive

0 commit comments

Comments
 (0)