Drop build metadata when bumping an old-style prerelease - #486
Merged
tomschr merged 2 commits intoSep 26, 2026
Merged
Conversation
next_version("prerelease") drops the build on every path except the
old-style one added in python-semver#485: 1.2.3-rc.3+build.5 becomes 1.2.3-rc.4, but
1.2.3-rc3+build.5 became 1.2.3-rc4+build.5. Pass build=None there as the
token-change branch below it already does.
tomschr
approved these changes
Sep 26, 2026
tomschr
left a comment
Member
There was a problem hiding this comment.
Thank you @youdie006! 👍 Looks good.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
next_version("prerelease")drops the build metadata on every path except the old-style one added in #485:The token-change branch right below it already passes
build=None, andtests/test_parsing.pypins build being dropped for the dot form (("1.2.3-rc.1+build.5", "prerelease", "1.2.3-rc.2")). This addsbuild=Noneto the old-style branch, a matching table row, and a test intests/test_issue484.py.Verification
Base
8c0a3f7.version.pymd5test_parsing.py+test_issue484.py4caab6b242test_issue_484_old_style_drops_build)0ec9530375num + 2instead ofnum + 10d7332a0rc3_to_rc4andrc9_to_rc10build=""instead ofbuild=None9bbb4881.build is None)Following
python-testing.yml:uv sync --all-extras --dev,uv pip install tox tox-gh-actions,uv run tox run -e 3.12gives 445 passed, 1 skipped (3.10 and 3.14 also pass).ruff checkreports the same 156 findings by rule on master and on this branch. Not run: macOS, 3.11, 3.13, 3.15.Written with AI assistance (Claude); the measurements above were run locally and I have reviewed the change.