-
Notifications
You must be signed in to change notification settings - Fork 964
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
don't remove the ability to get package versions via the JSON API #11991
Comments
I don't have any conceptual reason not to add a However, I do just want to point out that I think that parsing the filenames not being as efficient is not entirely accurate. The legacy JSON API has a ton of extra data inside of it, including the full long description of the project, which has a theoretically unbounded length (and for some projects appear to be approaching 7MB just from the long description alone). You can't state that "simply reading the answer" is more efficient, without first accounting for the fact that you've already wasted time and bandwidth downloading potentially large amounts of data that you're not even using. Overall, I'd prefer that we look at iterating on the simple API for features that installers need, as that's our golden path here. But I don't think it would be rejected if someone were to write a PR to add a versions key to the legacy json API. |
I've no objection to limiting either the amount of data that is allowed to be in a description or the amount of data that is returned in a description; nor to the simple API being made more useful for installers. I see your hint re a PR - thanks - not sure that I'm likely to get to it in the very near future but it could happen. Clues as to where the relevant code is certainly welcome anyway, whether for my benefit or someone else's. |
Adding to the comments of @dimbleby:
But, yes, I also would be quite content to see the Simple API made more useful for installers / lock managers / etc.... |
The simple API now includes an array that lists all of the versions of a project, which I believe removes the concern over using the simple API for getting this information (AIUI, the concern is that parsing filenames is less efficient than just getting a list of versions from the service). I'm going to close this issue (and the related PR, sorry I never got around to reviewing it, the pandemic ruined my ability to focus and this fell off my plate) with the expectation that the simple API should suffice now for this use case. |
According to the PyPa API Reference, the `releases` key of the JSON API is deprecated: https://warehouse.pypa.io/api-reference/json.html Confusingly, the Simple API is recommended. The Simple API was originally described in PEP 503 (2015), but an updated version was proposed in PEP 691 (2022) that adds a JSON response. However, this API does *not* include the same information as in the `releases` key of the current JSON API. But the PyPa authors are unlikely to add it back: pypi/warehouse#11991 So, this PR instead follows their recommended path, which is to parse versions from uploaded filenames (!). Closes scientific-python#218
According to the PyPa API Reference, the `releases` key of the JSON API is deprecated: https://warehouse.pypa.io/api-reference/json.html Confusingly, the Simple API is recommended. The Simple API was originally described in PEP 503 (2015), but an updated version was proposed in PEP 691 (2022) that adds a JSON response. However, this API does *not* include the same information as in the `releases` key of the current JSON API. But the PyPa authors are unlikely to add it back: pypi/warehouse#11991 So, this PR instead follows their recommended path, which is to parse versions from uploaded filenames (!). Closes scientific-python#218
According to the PyPa API Reference, the `releases` key of the JSON API is deprecated: https://warehouse.pypa.io/api-reference/json.html Confusingly, the Simple API is recommended. The Simple API was originally described in PEP 503 (2015), but an updated version was proposed in PEP 691 (2022) that adds a JSON response. However, this API does *not* include the same information as in the `releases` key of the current JSON API. But the PyPa authors are unlikely to add it back: pypi/warehouse#11991 So, this PR instead follows their recommended path, which is to parse versions from uploaded filenames (!). Closes scientific-python#218
According to the PyPa API Reference, the `releases` key of the JSON API is deprecated: https://warehouse.pypa.io/api-reference/json.html Confusingly, the Simple API is recommended. The Simple API was originally described in PEP 503 (2015), but an updated version was proposed in PEP 691 (2022) that adds a JSON response. However, this API does *not* include the same information as in the `releases` key of the current JSON API. But the PyPa authors are unlikely to add it back: pypi/warehouse#11991 So, this PR instead follows their recommended path, which is to parse versions from uploaded filenames (!). Closes #218 --------- Co-authored-by: Jarrod Millman <jarrod.millman@gmail.com>
#11777 marked the "releases" key deprecated.
This would be painful in poetry, which uses that part of the API to determine the available versions of a package.
Per python-poetry/poetry#6076 (comment), I think a sensible API and poetry's needs are aligned here:
perhaps it would make sense to replace
"releases"
with eg"versions"
, listing the available versions.NB parsing the simple API (even in json form) is a less satisfactory approach for poetry. Eg consider a package like cryptography, for which there are maybe a couple of dozen downloads available at each release: to get the available versions poetry would have to iterate over each of those files and parse their names - rather than simply reading the answer. Clearly this is much less efficient.
The text was updated successfully, but these errors were encountered: