Skip to content
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

Prioritize forks based on upper bounds #5643

Merged
merged 1 commit into from
Jul 31, 2024
Merged

Conversation

charliermarsh
Copy link
Member

Summary

Given a fork like:

pylint < 3 ; sys_platform == 'darwin'
pylint > 2 ; sys_platform != 'darwin'

Solving the top branch will typically yield a solution that also satisfies the bottom branch, due to maximum version selection (while the inverse isn't true).

To quote an example from the docs:

// If there's no difference, prioritize forks with upper bounds. We'd prefer to solve
// `numpy <= 2` before solving `numpy >= 1`, since the resolution produced by the former
// might work for the latter, but the inverse is unlikely to be true due to maximum
// version selection. (Selecting `numpy==2.0.0` would satisfy both forks, but selecting
// the latest `numpy` would not.)

Closes #4926 for now.

@charliermarsh charliermarsh added enhancement New feature or request preview Experimental behavior labels Jul 30, 2024
@charliermarsh charliermarsh marked this pull request as ready for review July 30, 2024 23:37
})
.count();

self_upper_bounds.cmp(&other_upper_bounds)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a heuristic of course, and we don't really have a ton of examples to inform this work.

@konstin
Copy link
Member

konstin commented Jul 31, 2024

While this is an improvement, it does not fix the transformers example. Fork points for transformers:

  • Splitting on pydantic==2.8.2 over typing-extensions
  • Splitting on opencv-python==4.10.0.84 over numpy
  • Splitting on pandas==2.2.2 over numpy
  • Splitting on botocore==1.34.151 over urllib3

I think we need to prioritize based on python_version for that. I haven't dug in what part is missing yet.

@charliermarsh
Copy link
Member Author

@konstin - Can you link to that example, and I'll explore it?

Base automatically changed from charlie/prioritiz to main July 31, 2024 14:29
@konstin
Copy link
Member

konstin commented Jul 31, 2024

I'Ve added it in #5657

@charliermarsh
Copy link
Member Author

Thanks! I'll merge this and then explore that separately.

@charliermarsh charliermarsh merged commit c2a6cb3 into main Jul 31, 2024
57 checks passed
@charliermarsh charliermarsh deleted the charlie/prioritize-cap branch July 31, 2024 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request preview Experimental behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prioritize forks
3 participants