-
Notifications
You must be signed in to change notification settings - Fork 968
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
API for fetching latest and stable versions #4663
Comments
I don't know what fraction of PyPI's bandwidth is consumed by JSON requests, but I feel a bit bad pulling down the entire |
@bskinn Most of the bandwidth is consumed by distributions (files), not JSON. And even then, 90-something percent of it is cached by our CDN -- so don't feel bad 🙂 That said, this API makes sense to me and would be relatively easy to implement. The hard part is getting it right. Something like the following seems to cover all use cases to me:
Should just be redirects to the actual versions? E.g. |
<nod>, those three, and their names, make sense to me. Main catch scenarios are (1) for all three, if no versions are available, and (2) specifically for |
I imagine that they'd be 404 instead in that case, same as if the project didn't actually exist. Another question, should any of these include yanked releases? I think not. |
Yeah, I figured they'd 404. Not knowing the warehouse codebase that well, though, I wasn't sure if there's already machinery there that would cleanly handle this particular failure mode & kick out the 404. Agreed, I figure it should mimic the behavior of |
If I read the model code correctly, If so (and if this is the right place in the codebase to implement the search), could just implement two variations that provide |
That would make sense to me! |
Ok... I've been poking at this, and I think I'll try to put together a PR for it. One question, @di -- what is the semantic meaning of a NULL value for
Regardless of the above, I figure |
As far as I can tell, it should never actually return NULL. It's a column property: defined by this function: but |
Looks like it was added in #3470 |
Maybe it's a guard against a mangled table? Regardless, looks like there's no need to consider the NULL case; and shouldn't hurt anything to just keep the .nullslast() in the call flow, in case. Thanks! |
I'd also like to be able to link to the latest and stable versions: .. image:: https://img.shields.io/pypi/v/modernize/latest?logo=pypi
:alt: PyPI Latest
:target: https://pypi.org/project/modernize/latest
.. image:: https://img.shields.io/pypi/v/modernize/stable?logo=pypi
:alt: PyPI Stable
:target: https://pypi.org/project/modernize/stable |
I would still find this useful! |
What's the problem this feature will solve?
Tools could use simple lookup logic for checking their latest and stable versions. The way it is currently done in
pip
is crazy:https://github.com/pypa/pip/blob/35d51f1f405f6f31d68c800e73307686ec029254/src/pip/_internal/utils/outdated.py#L104-L118
Describe the solution you'd like
It should be as simple as fetching https://pypi.org/pypi/pip/latest/json or https://pypi.org/pypi/pip/stable/json endpoints.
The text was updated successfully, but these errors were encountered: