Pypi Datasource¶
Table of values¶
| Name | Value | Notes |
|---|---|---|
| Identifier | pypi |
|
| Default versioning | pep440 |
|
| Custom registry support | Yes | |
| Release timestamp support | Yes | The release timestamp is determined from the earliest upload_time field of the files of a version. When using the Simple API, timestamps are available if the server supports the JSON-based Simple API (PEP 691). |
| Source URL support | Yes | The source URL is determined from the homepage field if it is a github repository, else we use the project_urls field. |
Description¶
This datasource uses the following logic to determine lookup URLs:
- If the normalized registryUrl ends in
/simple/or/+simple/then only the simple API will be tried - Otherwise, the JSON API will be tried first
- If the JSON API returns a result, it will be used
- If the JSON API throws an error (e.g. 403, 404) then the simple API will be tried
The Simple API supports both the HTML serialization (PEP 503) and the JSON serialization (PEP 691).
Renovate uses content negotiation (an Accept header) to prefer the JSON serialization, falling back to HTML automatically if the registry does not support it.
If the registry responds 406 because it cannot serve any of the negotiated types, Renovate retries the request without that header.
Renovate reads the release timestamp from the upload_time of a version's files, or the upload-time (PEP 700), which the Simple JSON API exposes, so minimumReleaseAge works against it.
If you are using Artifactory, you must explicitly enable the generation of upload-time metadata server-side.