Fork resolution when Python requirement is narrowed#4712
Closed
charliermarsh wants to merge 4 commits intomainfrom
Closed
Fork resolution when Python requirement is narrowed#4712charliermarsh wants to merge 4 commits intomainfrom
charliermarsh wants to merge 4 commits intomainfrom
Conversation
Member
Author
|
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
charliermarsh
commented
Jul 1, 2024
| { 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'" }, |
Member
Author
There was a problem hiding this comment.
Ok yeah this is just wrong.
Member
Author
|
Open to better ideas here. I think what I have in this PR is wrong actually. |
Member
|
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
Member
|
Is this still applicable with #6143? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 ofuvthat 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 packagefoothat depended onuv, andfoo ; python_version >= "3.8".Closes #4668.