-
Notifications
You must be signed in to change notification settings - Fork 39
fix(resolver): redesign resolver cache #793
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
Conversation
|
|
06cd5ce to
2bc01ea
Compare
|
It looks like ruff is not happy with the formatting of a file |
68edefd to
9e71b5c
Compare
|
I'm happy with this version but I would like another pair of eyes to look at it. |
|
Before (this code): After: |
LalatenduMohanty
left a comment
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.
We should add a test demonstrating the numpy scenario from #766
With the code change we need to udpate, docs/hooks.rst for VersionSource Signature
|
There might be more changes we need to do in the docs/hooks.rst. Cursor identified these cases. [ ] Fix _version_source() to take only identifier parameter |
rd4398
left a comment
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.
This looks good. I see @LalatenduMohanty has some comments so I will wait for him to approve
Redesign the resolver cache to address multiple issues. 1. The cache now holds all candidates from the provider. Before it only stored candidates that also fulfilled the requirement and constraints. 2. The cache now takes sdist url, GitHub repo, and GitLab project into account. Before a cache for local PyPI and pypi.org were mixed. 3. GenericProvider no longer caches candidates. There is no way to construct a good cache key. Bootstrapper is using GenericProvider in way that does not benefit from caching either. 4. There is just one global cache object for all providers. The new design makes it easier to clear all caches or just the cache for a single identifier. 5. The custom logic for each provider class is now in `find_candidates` function. The method just has to return an iterable of candidates. The caching logic is handled by the rest of the code. 6. Consumers can now opt out of caching with `use_resolver_cache=False` argument. 7. All resolver classes now require keyword arguments. The base provider no longer takes PyPI-only arguments like `include_sdists`. Fixes: python-wheel-build#766 Signed-off-by: Christian Heimes <[email protected]>
|
@LalatenduMohanty I have updated and fixed the example in the docs |
|
@LalatenduMohanty I don't know how to reproduce that problem. Maybe you can come up with a test? |
Sounds good. I have a test locally I can send in a separate PR. So lets go ahead and merge this PR. |
|
Created a issue to track this #838 |
The test tests the fix we did as part of python-wheel-build#793 Signed-off-by: Lalatendu Mohanty <[email protected]>
The test tests the fix we did as part of python-wheel-build#793 Fixes python-wheel-build#838 Signed-off-by: Lalatendu Mohanty <[email protected]>
This tests the fix we did as part of python-wheel-build#793 Fixes python-wheel-build#838 Signed-off-by: Lalatendu Mohanty <[email protected]>
This tests the fix we did as part of python-wheel-build#793 Fixes python-wheel-build#838 Signed-off-by: Lalatendu Mohanty <[email protected]>
This tests the fix we did as part of PR python-wheel-build#793 which fixes python-wheel-build#766 Fixes python-wheel-build#838 Signed-off-by: Lalatendu Mohanty <[email protected]>
This tests the fix we did as part of PR python-wheel-build#793 which fixes python-wheel-build#766 Fixes python-wheel-build#838 Signed-off-by: Lalatendu Mohanty <[email protected]>
This tests the fix we did as part of PR python-wheel-build#793 which fixes python-wheel-build#766 Fixes python-wheel-build#838 Signed-off-by: Lalatendu Mohanty <[email protected]>
Redesign the resolver cache to address multiple issues.
find_candidatesfunction. The method just has to return an iterable of candidates. The caching logic is handled by the rest of the code.use_resolver_cache=Falseargument.include_sdists.Fixes: #766