Is there an existing issue for this?
What keywords did you use to search existing issues?
twine check
Please describe the problem you are attempting to solve with this request
Use twine check to know early enough (pre-commit hook) if an upload of a package to https://pypi.org/ will succeed or fail.
How do you think we should solve this?
twine check should ideally fail for all possible reasons that https://pypi.org/ would reject a package. Or at least the ones that can be determined from the package alone.
Anything else you'd like to mention?
In the past I had a problem uploading a package to pypi, after which I realized that twine check would have already told me that the package was going to be rejected. So I added twine check in a pre-commit hook to avoid this happening again. Unfortunately, it happened again, but this time the package passed with twine check.
Today looking at the docs I see the description of twine check being "Checks whether your distribution’s long description will render correctly on PyPI". On one hand, not great that when I run twine check --help there is no such description. On the other hand, it seems quite misleading that check is only for "long description". I don't know if the original idea was to extend check more and more, and it was never done. Or it has been done and the docs don't say it.
The reason why my package was rejected is:
ERROR HTTPError: 400 Bad Request from https://upload.pypi.org/legacy/
Can't have direct dependency: jsonnet@
https://github.com/google/jsonnet/zipball/master ; python_version ==
"3.13" and extra == "jsonnet". See
https://packaging.python.org/specifications/core-metadata for more
information.
For reference, this relates to google/jsonnet#1172.
Is there an existing issue for this?
What keywords did you use to search existing issues?
twine check
Please describe the problem you are attempting to solve with this request
Use
twine checkto know early enough (pre-commit hook) if an upload of a package to https://pypi.org/ will succeed or fail.How do you think we should solve this?
twine checkshould ideally fail for all possible reasons that https://pypi.org/ would reject a package. Or at least the ones that can be determined from the package alone.Anything else you'd like to mention?
In the past I had a problem uploading a package to pypi, after which I realized that
twine checkwould have already told me that the package was going to be rejected. So I addedtwine checkin a pre-commit hook to avoid this happening again. Unfortunately, it happened again, but this time the package passed withtwine check.Today looking at the docs I see the description of
twine checkbeing "Checks whether your distribution’s long description will render correctly on PyPI". On one hand, not great that when I runtwine check --helpthere is no such description. On the other hand, it seems quite misleading thatcheckis only for "long description". I don't know if the original idea was to extendcheckmore and more, and it was never done. Or it has been done and the docs don't say it.The reason why my package was rejected is:
For reference, this relates to google/jsonnet#1172.