feat: implement conflict promotion logic in requirement selection#3751
feat: implement conflict promotion logic in requirement selection#3751
Conversation
Signed-off-by: Frost Ming <[email protected]>
…n complex conflicts Signed-off-by: Frost Ming <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9970fa8dcf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if name not in resolutions: | ||
| self._conflict_counts[name] += 1 | ||
| if self._conflict_counts[name] >= _CONFLICT_PRIORITY_THRESHOLD: | ||
| self._conflict_promoted.add(name) |
There was a problem hiding this comment.
Count promotions only on new backtracks
This increments _conflict_counts every time narrow_requirement_selection() runs with the last backtrack_causes, but resolvelib keeps that same backtrack_causes list across subsequent successful rounds. In practice, a package that conflicted once can cross the threshold after a few unrelated pins and get added to _conflict_promoted permanently. That turns this into a “stale last conflict” heuristic instead of a “repeated conflicts” heuristic, which can reorder later rounds badly enough to hit resolve_max_rounds on otherwise-solvable dependency sets.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
To use Codex here, create an environment for this repo.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3751 +/- ##
==========================================
+ Coverage 86.09% 86.12% +0.03%
==========================================
Files 118 118
Lines 12374 12406 +32
Branches 2060 2071 +11
==========================================
+ Hits 10653 10685 +32
Misses 1150 1150
Partials 571 571
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Frost Ming [email protected]
Related link: pypa/pip#13859
Pull Request Checklist
news/describing what is new.Describe what you have changed in this PR.