Skip to content

feat(gapic-generator-python): setup.py matches prereleases#17370

Draft
noahdietz wants to merge 2 commits into
googleapis:mainfrom
noahdietz:ggp-version-matcher
Draft

feat(gapic-generator-python): setup.py matches prereleases#17370
noahdietz wants to merge 2 commits into
googleapis:mainfrom
noahdietz:ggp-version-matcher

Conversation

@noahdietz
Copy link
Copy Markdown
Contributor

@noahdietz noahdietz commented Jun 3, 2026

Expand the version_candidates matching regex in setup.py to support SemVer prerelease suffixes.

To support both SemVer and PEP 440 prerelease formats robustly, we can match any trailing non-quote, non-whitespace characters after the major.minor.patch version.

Towards googleapis/librarian#6289

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 updates the regular expression used to parse version strings in setup.py templates and golden files to support prerelease suffixes. The reviewer notes that the proposed regex strictly expects a hyphen for prerelease versions, which would fail for PEP 440 compliant versions without a hyphen (such as 1.0.0a1). To prevent installation crashes, the reviewer suggests a more robust regex that matches any trailing non-quote, non-whitespace characters after the patch version.

Comment thread packages/gapic-generator/gapic/templates/setup.py.j2
Comment thread packages/gapic-generator/tests/integration/goldens/asset/setup.py
Comment thread packages/gapic-generator/tests/integration/goldens/logging/setup.py
Comment thread packages/gapic-generator/tests/integration/goldens/redis/setup.py
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