-
-
Notifications
You must be signed in to change notification settings - Fork 587
More general support for platform_release #2821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
What do the specs say about:
I looked at the pypa docs quickly, but didn't see anything specifically mentioned about them. So, we should probably just implement it as a regular string comparison? |
The grammar and spec for markers is standardized by PEP 508 https://peps.python.org/pep-0508/ The comparisons are typed by the comparison operator (>= in this issue). ">=" is a version_cmp If LHS and RHS are both valid versions (PEP 440) then version comparison takes place. Otherwise it falls back to the default Python behaviour. Relevant part of the spec copied below. Comparisons in marker expressions are typed by the comparison operator. The operators that are not in perform the same as they do for strings in Python. The operators use the version comparison rules of the Version specifier specification when those are defined (that is when both sides have a valid version specifier). If there is no defined behaviour of this specification and the operator exists in Python, then the operator falls back to the Python behaviour. Otherwise an error should be raised. e.g. the following will result in errors: There are standardized implementations of the spec in pypa/packaging, so perhaps we should consider using that or attempting to reproduce the tests in a Starlark implementation as some kind of compatibility test. |
Marking this as a feature request to have proper support for |
π bug report
Description
The
>=
operator should be supported forplatform_release
.π¬ Minimal Reproduction
requirements.in
has just:BUILD.bazel
has:Running
bazel run //:generate_requirements
creates a .lock file with lots of entries like:Then when you try to
bazel run
anything, you get the crash:π Your Environment
Operating System:
Output of
bazel version
:Rules_python version:
Anything else relevant?
Slack thread: https://bazelbuild.slack.com/archives/CA306CEV6/p1745423125646599
The text was updated successfully, but these errors were encountered: