Skip to content

fix(release): compare normalized prerelease versions - #1015

Merged
bokelley merged 1 commit into
mainfrom
fix/release-version-normalization
Aug 5, 2026
Merged

fix(release): compare normalized prerelease versions#1015
bokelley merged 1 commit into
mainfrom
fix/release-version-normalization

Conversation

@bokelley

@bokelley bokelley commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • compare the release manifest version after applying the same SemVer-to-PEP-440 normalization used by the release workflow
  • keep stable-version comparisons unchanged

Root cause

Release Please stores 7.0.0-rc.1 in its manifest, while Python packaging correctly requires 7.0.0rc1 in pyproject.toml. The release configuration test compared these equivalent versions as raw strings, blocking the 7.0.0-rc.1 release PR.

Validation

  • pytest tests/test_release_configuration.py tests/test_normalize_pyproject_prerelease.py: 6 passed
  • Ruff and format checks passed
  • full pre-commit suite passed

@bokelley
bokelley enabled auto-merge (squash) August 5, 2026 02:47

@aao-ipr-bot aao-ipr-bot 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.

LGTM. Reuses the release workflow's own normalizer instead of re-encoding the SemVer→PEP-440 rule in the test — the assertion now checks the same transform that actually runs on the wire.

Things I checked

  • Root cause is real. Release Please stores 7.0.0-rc.1 in .release-please-manifest.json; PEP 440 requires 7.0.0rc1 in pyproject.toml. The old raw-string compare blocked the RC release PR.
  • The fix imports pep440_prerelease from scripts/normalize_pyproject_prerelease.py rather than duplicating the mapping — single source of truth with the code that normalizes pyproject.toml at release time.
  • Stable-version path unchanged: pep440_prerelease returns input verbatim when _SEMVER_PRERELEASE_RE doesn't match, so 7.0.0 / 8.1.2 still compare as raw strings (normalize_pyproject_prerelease.py:27-34).
  • Numbered prerelease maps correctly: 7.0.0-rc.17.0.0rc1, alpha/betaa/b. Test-only diff, no source or public surface touched.
  • Test-only change → skip-everything list, no experts.

Minor nits (non-blocking)

  1. Numberless label passes through unnormalized. The regex requires -(alpha|beta|rc)\.(\d+), so a manifest value like 7.0.0-rc (no .N) returns unchanged — which is the current state of both files, so the assertion holds by identity rather than by normalization. Not this PR's job to fix, and release-please always emits the numbered form; worth a follow-up only if the manifest ever drifts to a bare label.

LGTM.

@bokelley
bokelley merged commit 87140b4 into main Aug 5, 2026
26 checks passed
@bokelley
bokelley deleted the fix/release-version-normalization branch August 5, 2026 02:54
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