Skip to content

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

Merged
noahdietz merged 2 commits into
googleapis:mainfrom
noahdietz:ggp-version-matcher
Jun 4, 2026
Merged

feat(gapic-generator-python): setup.py matches prereleases#17370
noahdietz merged 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.

Regenerated one API and opened a PR to see checks passing.

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
@noahdietz noahdietz marked this pull request as ready for review June 4, 2026 22:01
@noahdietz noahdietz requested a review from a team as a code owner June 4, 2026 22:02
@noahdietz noahdietz merged commit 25b857e into googleapis:main Jun 4, 2026
90 checks passed
@noahdietz noahdietz deleted the ggp-version-matcher branch June 4, 2026 22:16
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.

2 participants