Skip to content
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

Extend twine check to fail on all reasons for which pypi.org would reject a package #1152

Open
1 task done
mauvilsa opened this issue Sep 25, 2024 · 0 comments
Open
1 task done

Comments

@mauvilsa
Copy link

mauvilsa commented Sep 25, 2024

Is there an existing issue for this?

  • I have searched the existing issues (open and closed), and could not find an existing issue

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant