-
Notifications
You must be signed in to change notification settings - Fork 762
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
Always use release-only comparisons for requires-python
#4794
Conversation
4cfb8a2
to
7c152c9
Compare
Gotta fix the snapshots, which is just about how we display those versions. |
#[inline] | ||
#[must_use] | ||
pub fn only_release(&self) -> Self { | ||
Self::new(self.release().iter().copied()) |
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.
Is it worth trying to avoid a copy here?
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.
We should add this to the documentation, otherwise the requires-python
semantics are indecipherable after reading our prerelease version handling section.
@@ -148,3 +148,101 @@ impl TryFrom<&VersionSpecifier> for PubGrubSpecifier { | |||
Ok(Self(ranges)) | |||
} | |||
} | |||
|
|||
impl PubGrubSpecifier { |
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.
Can we merge the two impl PubGrubSpecifier
blocks?
Sounds good. I'll add some more documentation. |
ca57771
to
309d708
Compare
309d708
to
416e17c
Compare
Summary
There are a few ideas at play here:
Requires-Python
, so we now do the same. That means, e.g., using3.13.0b0
will be accepted by a project withRequires-Python: >= 3.13
, which does not adhere to PEP 440 semantics but is somewhat intuitive.python_version >= '3.10' or python_version < '3.10'
can be collapsed to the truthy marker.Closes #4714.
Closes #4272.
Closes #4719.