fix(resolver): cache known versions by package name#1188
Conversation
📝 WalkthroughWalkthrough
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@dhellmann This alone might not fix the issue |
…ython-wheel-build#1187 exempt_versions Cover top-level == pin scenarios where transitive deps use a different requirement specifier. These validate the python-wheel-build#1157 exempt_versions fix; session-cache coverage remains in python-wheel-build#1188. Co-Authored-By: Claude <claude@anthropic.com> Signed-off-by: Lalatendu Mohanty <lmohanty@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com>
tiran
left a comment
There was a problem hiding this comment.
IMO the suggestion from 1187 is not the best solution. Breadth-first resolution of top-level requirements should solve the issue, too.
@tiran I agree that 1187 is not the best solution however, I think the BFS approach will make things more complicated. I see the following challenges:
Some points to consider:
Let me know what you think / whether I am missing anything. cc @LalatenduMohanty @dhellmann |
UPDATE: I posted this before reading Doug's comment here: #1187 (comment) |
Replace the per-requirement-string resolution cache with a package-level known-versions cache, as discussed in issue python-wheel-build#1187. The resolver now: 1. Tracks which requirement rules have been resolved to avoid redundant network calls. 2. Accumulates all discovered versions into a package-level cache keyed by (normalized_name, pre_built). 3. Filters the accumulated versions by the current specifier, returning the widest available set. This ensures that versions discovered in one context (e.g., top-level with cooldown bypass finding v2.0) are visible to later lookups with different specifiers (e.g., transitive A>=1.0 will see v2.0 even though its own network call only found v1.5). Co-Authored-By: Claude <claude@anthropic.com> Closes: python-wheel-build#1187 Signed-off-by: Rohan Devasthale <rdevasth@redhat.com>
|
@dhellmann @LalatenduMohanty @tiran I have implemented Doug's suggestion which was discussed here in my latest commit |
Replace the per-requirement-string resolution cache with a
package-level known-versions cache, as discussed in issue #1187.
The resolver now:
redundant network calls.
keyed by (normalized_name, pre_built).
returning the widest available set.
This ensures that versions discovered in one context (e.g., top-level
with cooldown bypass finding v2.0) are visible to later lookups with
different specifiers (e.g., transitive A>=1.0 will see v2.0 even
though its own network call only found v1.5).
Co-Authored-By: Claude claude@anthropic.com
Closes: #1187
Signed-off-by: Rohan Devasthale rdevasth@redhat.com