-
Notifications
You must be signed in to change notification settings - Fork 760
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
Match wheel tags against Requires-Python
major-minor
#5289
Conversation
// Ex) `>3.10.1` -> `>=3.10` | ||
// This is unintuitive, but `>3.10.1` does indicate that _some_ version of Python 3.10 | ||
// is supported. | ||
Bound::Excluded(version) => RequiresPythonBound(Bound::Included(Version::new( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is strange but I think correct...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah >3.10
is a footgun because it does actually include 3.10
version, this is basically PYI006
b17f9eb
to
ea69f7a
Compare
For warehouse with |
// Ex) `>3.10.1` -> `>=3.10` | ||
// This is unintuitive, but `>3.10.1` does indicate that _some_ version of Python 3.10 | ||
// is supported. | ||
Bound::Excluded(version) => RequiresPythonBound(Bound::Included(Version::new( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah >3.10
is a footgun because it does actually include 3.10
version, this is basically PYI006
Yeah, unfortunately I think we kinda have to do this, unless we want to change our |
The most correct solution is probably computing an upper bound the same way we compute the lower bound, incl. widening to the next full major-minor version/discarding the patch version, and then only applying the lower bound for matching dependencies' requires-python, but applying the lower and the upper bound for selecting their wheels. (Giving us requires-python semantic #3, i think). Improving this isn't schema-breaking or badly breaking backwards compatibility (the wheels can never be selected anyway), so we can move this post-release-ready. |
Summary
Given
Requires-Python: ">=3.12.3"
, we were rejecting wheels likedearpygui-1.11.1-cp312-cp312-win_amd64.whl
, since3.12.0
is not included in>=3.12.3
. We instead need to test against the major-minor version ofRequires-Python
.The easiest way to do this, I think, is the use the
RequiresPython
struct, which has a single bound that we can truncate the major-minor. This also means that we now allowdearpygui-1.11.1-cp312-cp312-win_amd64.whl
for specifiers likeRequires-Python: "==3.10.*"
. This is incorrect on the surface, but it does match our semantics forRequires-Python
elsewhere: we treat it as a lower bound.Closes #5287.