Skip to content

Commit 436ef9d

Browse files
committed
instead of fixing the test, do something more clever - check for equality as well
1 parent e545c7d commit 436ef9d

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

python/private/py_wheel_normalize_pep440.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -611,14 +611,14 @@ def _version_ge(left, right):
611611
# https://peps.python.org/pep-0440/#inclusive-ordered-comparison
612612
_left = left.key(local = False)
613613
_right = right.key(local = False)
614-
return _left >= _right
614+
return _left > _right or _version_eq(left, right)
615615

616616
def _version_le(left, right):
617617
# PEP440: simple order check
618618
# https://peps.python.org/pep-0440/#inclusive-ordered-comparison
619619
_left = left.key(local = False)
620620
_right = right.key(local = False)
621-
return _left <= _right
621+
return _left < _right or _version_eq(left, right)
622622

623623
def _first_non_none(*args):
624624
for arg in args:

tests/pypi/env_marker_setting/env_marker_setting_tests.bzl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ def _test_expr(name):
1919
)
2020

2121
cases = {
22-
"python_full_version_gte": {
22+
"python_full_version_lt_negative": {
2323
"config_settings": {
2424
PYTHON_VERSION: "3.12.0",
2525
},
26-
"expected": "TRUE",
27-
"expression": "python_full_version >= '3.12.0'",
26+
"expected": "FALSE",
27+
"expression": "python_full_version < '3.8'",
2828
},
29-
"python_full_version_lt_negative": {
29+
"python_version_gte": {
3030
"config_settings": {
3131
PYTHON_VERSION: "3.12.0",
3232
},
33-
"expected": "FALSE",
34-
"expression": "python_full_version < '3.8'",
33+
"expected": "TRUE",
34+
"expression": "python_version >= '3.12.0'",
3535
},
3636
}
3737

0 commit comments

Comments
 (0)