Add opt-in semantic version equality for trailing zeros (1.0 == 1.0.0)#495
Draft
Add opt-in semantic version equality for trailing zeros (1.0 == 1.0.0)#495
Conversation
Co-authored-by: ludeeus <15093472+ludeeus@users.noreply.github.com>
Deploying awesomeversion with
|
| Latest commit: |
41c3a94
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://fd8eb5d3.awesomeversion.pages.dev |
| Branch Preview URL: | https://copilot-fix-version-comparis.awesomeversion.pages.dev |
Co-authored-by: ludeeus <15093472+ludeeus@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix version comparison logic for AwesomeVersion
Fix semantic version equality for trailing zeros (1.0 == 1.0.0)
Nov 18, 2025
ludeeus
reviewed
Nov 19, 2025
Co-authored-by: ludeeus <15093472+ludeeus@users.noreply.github.com>
ludeeus
reviewed
Nov 19, 2025
| """Check if equals to.""" | ||
| compareto = self._ensure_awesome_version(compareto) | ||
| return self.string == compareto.string | ||
|
|
Owner
There was a problem hiding this comment.
@copilot make this new logic be opt-in by setting a kwarg to true
Contributor
Author
There was a problem hiding this comment.
Made the semantic equality logic opt-in in commit 41c3a94. Added a semantic_equality kwarg that defaults to False for backward compatibility. Users must explicitly set semantic_equality=True to enable the trailing zeros equality behavior (e.g., AwesomeVersion("1.0", semantic_equality=True)).
Co-authored-by: ludeeus <15093472+ludeeus@users.noreply.github.com>
Copilot
AI
changed the title
Fix semantic version equality for trailing zeros (1.0 == 1.0.0)
Add opt-in semantic version equality for trailing zeros (1.0 == 1.0.0)
Nov 19, 2025
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.
What does this PR do?
Adds an opt-in
semantic_equalityparameter to enable semantic version comparison where trailing zeros are considered equivalent (e.g.,"1.0"equals"1.0.0"). By default, the behavior remains unchanged for backward compatibility.Key Features:
semantic_equality=False)semantic_equality=Trueto enable trailing zeros equalityType of change (pick one)
Related issues or links
Fixes #491
Checklist
script/lint)Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.