Commit e734d5f
committed
fix(resolver): redesign resolver cache
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: #766
Signed-off-by: Christian Heimes <[email protected]>1 parent b15ad7b commit e734d5f
File tree
4 files changed
+258
-194
lines changed- docs
- src/fromager
- tests
4 files changed
+258
-194
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | | - | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
160 | 163 | | |
161 | 164 | | |
162 | 165 | | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
| 166 | + | |
| 167 | + | |
167 | 168 | | |
168 | 169 | | |
169 | 170 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
901 | 901 | | |
902 | 902 | | |
903 | 903 | | |
| 904 | + | |
904 | 905 | | |
905 | | - | |
| 906 | + | |
906 | 907 | | |
| 908 | + | |
907 | 909 | | |
908 | 910 | | |
909 | 911 | | |
| |||
0 commit comments