lib.version.Dependency.__version_boundaries(): Use Version.next()
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 4m42s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 4m43s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 4m30s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 4m29s
CI / Packaging test (push) Successful in 0s

Use Version.next() in __version_boundaries, which steps the last existing
part, so '= 1.0' spans '>= 1.0, < 1.1'.

Tests written by AI.

Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v0.85.1
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-09-15 19:58:24 +02:00
commit 3f00f4a416
Signed by: Jan Lindemann
GPG key ID: 3750640C9E25DD61
2 changed files with 21 additions and 11 deletions

View file

@ -74,13 +74,14 @@ class Dependency: # export
return (specified, )
ret: list[Boundary] = []
match specified.op:
case '>' | '>=':
ret.append(specified)
ret.append(Boundary('<', specified.version.next_binary_incompatible))
case '=':
try:
next_version = specified.version.next
except Version.Error:
return (specified, )
ret.append(Boundary('>=', specified.version))
ret.append(Boundary('<', specified.version.next_binary_incompatible))
case '<' | '<=':
ret.append(Boundary('<', next_version))
case '>' | '>=' | '<' | '<=':
ret.append(specified)
case _:
self.__raise(
@ -150,8 +151,9 @@ class Dependency: # export
NAMES_ONLY renders the name alone. With untemplated = False the
VERSION, VERSION-REVISION and REVISION macros are kept as
written instead of resolved. include_revision = False drops the
revision of VERSION specs. as_range expands a boundary that
pins a full version into the range it spans. no_subpackages
revision of VERSION specs. as_range expands a = boundary that
does not pin a full version into the range it spans; other
operators pass through unchanged. no_subpackages
renders the base name, quote wraps the result in the given
string.
"""