Skip to content

Use resolved scheme for emptiness check in ToVersString - #55

Merged
andrew merged 1 commit into
mainfrom
fix-toversstring-scheme
Sep 26, 2026
Merged

andrew merged 1 commit into
mainfrom
fix-toversstring-scheme

Conversation

@andrew

@andrew andrew commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

ToVersString resolves its scheme argument (falling back from r.Scheme) but then called r.IsEmpty(), which re-reads r.Scheme to pick a comparator. A schemeless Range from NewRange holding PyPI intervals like >=2016.11.0|<3003rc1 was judged empty under the generic comparator and serialised as vers:pypi/.

IsEmpty now delegates to an unexported isEmptyFor(scheme), and ToVersString calls that with the scheme it already resolved.

Fixes #52.

Copilot AI lite review requested due to automatic review settings September 24, 2026 15:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

ToVersString resolved its scheme argument but then called r.IsEmpty(),
which re-read r.Scheme. A schemeless Range from NewRange with PyPI
intervals was judged empty under the generic comparator and serialised
as vers:pypi/.

Fixes #52.
@andrew
andrew force-pushed the fix-toversstring-scheme branch from 6179250 to 0392d4b Compare September 26, 2026 08:38
@andrew
andrew merged commit 833b85e into main Sep 26, 2026
2 checks passed
@andrew
andrew deleted the fix-toversstring-scheme branch September 26, 2026 08:39
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.

ToVersString drops PyPI intervals when the range has no scheme

2 participants