It's not obvious which Pythons a package supports
From PyPI, it can be far from obvious which Pythons a package supports and doesn't support. For instance, the package mechanize doesn't support Python 3.x but that's not at all clear from its PyPI page.
Only if you are very familiar with PyPI can you deduce that from the absence of a Python 3 tag in the long list of categories at the bottom of the page. It's unreasonable to expect new users to do that, and it's demanding enough of the experienced. Adding to the confusion, there's also a "Py Version" label higher up the page, which is blank.
Of course, you could blame package authors for not stating compatibilities explicitly in their readme. But that would be unfair. Not all projects have or ever will have readmes. Some older projects were compatible with all Pythons at the time of their release, but are incompatible with contemporary Pythons.
Ideally, PyPI would give authoritative information on compatibility in a consistent and easy to read format. This would be helpful to everyone.
@hickford Thanks for the report!
This is, I think, improved in Warehouse -- see the mechanize page on pypi.org for an example. What do you think of this?
If you're happy with that, great! If not, I'd prefer continuing this conversation in a Warehouse issue.
Thanks.
This information can be expressed with the Requires-Python metadata field, but it’s not prominently shown on the PyPI page. Projects can choose to have descriptions that embed badges showing python version support, but that’s not the same as a standard display of the info.
You could argue that if you’re exploring projects, you would go to the code repository to find this information as well as others: recent activity, open bugs, pace of maintenance, general vibe… But there is value in PyPI pages being sufficient to a certain degree. So maybe there is a feature request for warehouse in this ticket.
It's shown under "Meta". The requires-python info only tells you the oldest Python version supported by the current version of the package, which isn't that important. For example, NumPy has "Requires: Python >=3.10". That's really not helpful for someone just searching around PyPI, though; NumPy works just fine with Python 3.9. It's just the latest version that doesn't support 3.9. And most people looking for packages will be just starting, which means they should be on a newish Python, and requires-python isn't helpful for that at all.
The badges help, but not everyone adds badges for each version.
But I'd say this really only mattered back when there was a division between Python 2 and Python 3, people actually did care if Python 3 was supported or not. 7 years later, most packages support the latest Python version or two, or are unmaintained.