renovate
renovate copied to clipboard
fix(pypi): lookup simple api first
Changes
This rewrites the getReleases
function of pypi datasources:
First, the the simple (pypi) api is queried, then the pypijson api is retried on 404s or to enrich the metadata.
For that, I adapted the formerly named getDependencies
functions to add their resolved data to an existing Result.
Previously, the simple api was only used, if pypijson returned 404.
The unit tests stayed mostly the same, but the simple api routes needed to be mocked. Also added testcases to check that both simple and json pypi apis are used, and dependency resolution succeeds if json api is unavailable.
Context
Closes #26483.
As pypijson is used additionally, #26383 is resolved as well.
Documentation (please check one with an [x])
- [ ] I have updated the documentation, or
- [x] No documentation update is required
How I've tested my work (please select one)
I have verified these changes via:
- [ ] Code inspection only, or
- [x] Newly added/modified unit tests, or
- [ ] No unit tests but ran on a real repository, or
- [ ] Both unit tests + ran on a real repository
Any progress on this? We're getting burned by it too.
@Kakadus do you have any time to resume this PR?