You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ToVersString drops PyPI intervals when the range has no scheme #52
vers.NewRange returns a Range with an empty Scheme. ToVersString(r, "pypi") then checks each interval for emptiness with the default semver comparison instead of the scheme it was given, so valid PyPI intervals are dropped.
a, _:=vers.Parse("vers:pypi/>=2016.11.0|<3003rc1")
fmt.Println(vers.ToVersString(vers.NewRange(a.Intervals), "pypi"))
// got: vers:pypi/// want: vers:pypi/>=2016.11.0|<3003rc1
>=0.5.0b3.dev13|<0.5.0b3.dev97 fails the same way. Parsing is correct: a.Contains("2019.2.0") is true and a.IsEmpty() is false. Setting Scheme: "pypi" on the range gives the right output.
This is seen in v0.7.0 and v0.7.1.
Suggested fix: ToVersString could use its scheme argument when r.Scheme is empty. Alternatively, NewRange could take a scheme.
Activity
andrew commentedon Sep 24, 2026
Thanks for reporting, opened a pr over here: #55
Use resolved scheme for emptiness check in ToVersString