Skip to content

Commit 5bfc9ad

Browse files
committed
wip: add explanatory comments
1 parent eb5ad5d commit 5bfc9ad

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/poetry/core/constraints/version/version_range_constraint.py

+12
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,15 @@ def allowed_min(self) -> Version | None:
3636
if self.min is None:
3737
return None
3838

39+
# That is a bit inaccurate because
40+
# 1) The exclusive ordered comparison >V MUST NOT allow a post-release
41+
# of the given version unless V itself is a post release.
42+
# 2) The exclusive ordered comparison >V MUST NOT match
43+
# a local version of the specified version.
44+
# https://peps.python.org/pep-0440/#exclusive-ordered-comparison
45+
# However, there is no specific min greater than the greatest post release
46+
# or greatest local version identifier. These cases have to be handled by
47+
# the callers of allowed_min.
3948
return self.min
4049

4150
@property
@@ -50,6 +59,9 @@ def allowed_max(self) -> Version | None:
5059
# this is an equality range
5160
return self.max
5261

62+
# The exclusive ordered comparison <V MUST NOT allow a pre-release
63+
# of the specified version unless the specified version is itself a pre-release.
64+
# https://peps.python.org/pep-0440/#exclusive-ordered-comparison
5365
return self.max.first_devrelease()
5466

5567
def allows_lower(self, other: VersionRangeConstraint) -> bool:

0 commit comments

Comments
 (0)