Skip to content

Introduce semantic equality, make (non-semantic) comparison total - #118

Merged
alexarchambault merged 3 commits into
coursier:mainfrom
alexarchambault:issue-10
Sep 4, 2026
Merged

Introduce semantic equality, make (non-semantic) comparison total#118
alexarchambault merged 3 commits into
coursier:mainfrom
alexarchambault:issue-10

Conversation

@alexarchambault

@alexarchambault alexarchambault commented Sep 4, 2026

Copy link
Copy Markdown
Member

Fixes #10
Fixes #13

alexarchambault and others added 3 commits September 4, 2026 13:06
Add a semantic comparison for interval and constraint logic while
using representation as a tie-breaker for total ordering.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
`ga` and `final` stand for the absence of a qualifier, so `1.1.0`,
`1.1.0.GA` and `1.1.0.Final` all mean the same version. `compareSemantic`
now returns 0 for them, which is what interval and constraint logic needs.

`compare` still tells them apart, in the order the coursier documentation
lists, so that it stays total and consistent with equality. The tests that
pin that documented order now use it rather than `compareSemantic`.

Also drop `1.0-a` from an equivalence group: since the ordering rework, a
lone `a` is a plain literal, and only expands to `alpha` when followed by
a digit.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Recognize semantic-version pre-releases while allowing release qualifiers
such as `Final` and `v20191220` to participate in compatibility checks.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
@alexarchambault
alexarchambault marked this pull request as ready for review September 4, 2026 11:13
@alexarchambault
alexarchambault merged commit 969b8cf into coursier:main Sep 4, 2026
4 checks passed
@alexarchambault
alexarchambault deleted the issue-10 branch September 4, 2026 11:13
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.

The compare Implementation On Version Is Inconsistent with equals And Invalid For PVP Support Netty and Jetty

1 participant