-
Notifications
You must be signed in to change notification settings - Fork 878
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
Trim injected python_version
marker to (major, minor)
#2395
Conversation
} | ||
if version.is_pre() { | ||
return Err(format!("Python version {s} is a pre-release")); | ||
} |
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.
I guess we can support this, but it makes the code below simpler because we can construct markers.python_full_version
by just looking at the releases. Otherwise, I need to add some more handling to it.
0163267
to
dd748c5
Compare
self.release()[0], | ||
self.release()[1], |
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.
Mildly confused that we use .get(...).unwrap...
elsewhere but not here?
731bc82
to
937bb86
Compare
937bb86
to
b4c6bcf
Compare
} | ||
|
||
impl PythonRequirement { | ||
pub fn new(interpreter: &Interpreter, markers: &MarkerEnvironment) -> Self { | ||
Self { | ||
installed: interpreter.python_version().clone(), | ||
target: markers.python_full_version.version.clone(), | ||
installed: interpreter.python_full_version().clone(), |
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 the same value, I just renamed the method because it's the python_full_version
marker.
4d61daf
to
7a119ee
Compare
7a119ee
to
2046136
Compare
Summary
Per PEP 508,
python_version
is just major and minor:Right now, we're using the provided version directly, so if it's, e.g.,
-p 3.11.8
, we'll inject the wrong marker. This was causingpandas
to omitnumpy
when-p 3.11.8
was provided, since its markers look like:Closes #2392.