renovate icon indicating copy to clipboard operation
renovate copied to clipboard

fix(pypi): lookup simple api first

Open Kakadus opened this issue 1 year ago • 1 comments

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

Kakadus avatar Jan 04 '24 15:01 Kakadus

Any progress on this? We're getting burned by it too.

mikecook avatar Mar 14 '24 00:03 mikecook

@Kakadus do you have any time to resume this PR?

rarkins avatar Jul 23 '24 11:07 rarkins