-
Notifications
You must be signed in to change notification settings - Fork 738
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
Fork resolution when Python requirement is narrowed #4712
Conversation
I'm honestly not sure if this is sound. |
7191a09
to
338ee08
Compare
a0b7f87
to
26d07d8
Compare
Respect fork markers Also narrow on dependencies
338ee08
to
b3797db
Compare
26d07d8
to
135fe79
Compare
@@ -397,7 +397,6 @@ fn root_package_splits_other_dependencies_too() -> Result<()> { | |||
{ name = "anyio", version = "4.2.0", source = { registry = "https://pypi.org/simple" }, marker = "python_version < '3.12'" }, | |||
{ name = "anyio", version = "4.3.0", source = { registry = "https://pypi.org/simple" }, marker = "python_version >= '3.12'" }, | |||
{ name = "b1", marker = "python_version < '3.12'" }, | |||
{ name = "b2", marker = "python_version >= '3.12'" }, |
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.
Ok yeah this is just wrong.
Open to better ideas here. I think what I have in this PR is wrong actually. |
I think the splitting can work, but we must only split when there the python marker is stricter than the current requires-python and be mindful if we're already splitting on the python version marker, which is happening |
b3797db
to
2305824
Compare
Is this still applicable with #6143? |
Summary
This is similar to #4707, but in this case, we don't actually fork, because there are no divergent requirements. Consider:
With
-p 3.7
. In this case, there's no version ofuv
that satisfies Python 3.7, but it's only required on Python 3.8 anyway.The solution I settled on here is to... fork anyway? I'd like to get some input before setting it out, but it makes some sense to me: we want to solve with a different set of constraints than in the rest of the resolution.
Initially, I tried to just merge the fork markers with the requirement markers (i.e., the
python_version >= "3.8"
on the requirement itself) -- but that's insufficient. Imagine if instead we had a packagefoo
that depended onuv
, andfoo ; python_version >= "3.8"
.Closes #4668.