Repository navigation
fix: validate and match prerelease token prefixes - #489
Merged
tomschr merged 2 commits intoOct 5, 2026
Merged
Conversation
MbappeWU
marked this pull request as ready for review
October 5, 2026 04:30
Member
|
Thank you very much, @MbappeWU! 👍 |
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.
Version.next_version("prerelease", token)can bypass the existing token validator when a prerelease already exists.rc+buildcreates fields that differ after parsing the object's own string, and[raises a regex error. Valid dotted tokens also fail:alpha.beta.1with tokenalpha.betastays unchanged, whilealphaXbeta9falsely matches that token as a regex pattern.Reuse the existing SemVer identifier validator, match old-style counters literally, and recognize a token family at an identifier boundary.
alpha.beta.1now advances toalpha.beta.2; an unrelated family resets toalpha.beta.1. Existing qualifier chains, legacyrc3, empty/None tokens, token switching, immutable inputs and ignored tokens for major/minor/patch remain supported. Add public regressions and the requiredpr489.bugfix.rstnewsfragment. Dependency, version, native backend, CLI and source workflow configuration are unchanged.Validation:
py312: 488 passed, 1 skipped, 100% coverage on CPython 3.12.13. Unchanged baseline: 471 passed, 1 skipped, 100% coverage. Exact original implementation with the same final next-version regressions: 36 passed, 9 failed.continue-on-error: true; baseline and final have no diagnostic delta. The same existing mypy native-import error and 12 Pyright diagnostics are also retained and recorded as failures.uvx makedocumentation wrapper fails on both because the PyPImakepackage provides no executables; this existing wrapper is outside the diff.Resource not accessible by integration/ configuration error. Its permissions and steps are unchanged. Upstream Python and CodeQL runs require maintainer approval, so upstream checks and review remain pending.