← 输入框|github.com|刷新
Skip to content

Use prerelease precedence for version compatibility - #527

Closed
wissaaamm wants to merge 5 commits into
python-semver:masterfrom
wissaaamm:fix/compatible-equivalent-prereleases
Closed

wissaaamm wants to merge 5 commits into
python-semver:masterfrom
wissaaamm:fix/compatible-equivalent-prereleases

Conversation

@wissaaamm

Copy link
Copy Markdown

Summary

Version.is_compatible() can reject two versions that compare equal. For example, a constructor call with prerelease="" compares equal to the same version with no prerelease, but the compatibility check compares those fields literally.

Apply the existing prerelease precedence comparison to compatibility checks. Major-zero versions still require matching numeric parts. Nonzero major versions keep the existing minor-version rule.

Verification

  • Four regression cases failed on upstream and passed after the fix.
  • In the approved offline Python 3.13 runner, 599 unit and documentation tests passed and one was skipped. The run used pytest without coverage collection and restored the two tracked fixture symlinks in the container’s temporary checkout.

I used AI assistance to investigate, implement, and test this change.

@tomschr

tomschr commented Nov 29, 2026

Copy link
Copy Markdown
Member

Hi @wissaaamm,
thank you for your contribution. Much appreciated! 🫶

The code looks good and solid. I'd suggest to look into the documentation Checking for a Compatible Semver Version and update the list accordingly.

Otherwise I think it's ready to be merged. Many thanks! 👍

@tomschr

tomschr commented Dec 1, 2026

Copy link
Copy Markdown
Member

This is strange. Although I hit the merge button, it's merged in master as commit 72734e6, but the PR is still open. 🤔

Closing it manually. @wissaaamm your contribution is already in master. Thanks!

@tomschr tomschr closed this Dec 1, 2026
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