-
Notifications
You must be signed in to change notification settings - Fork 306
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
Comments
This comment has been minimized.
This comment has been minimized.
See also #976, #854, #430 for previous discussions of Long term, I would love to see |
@woodruffw thanks for the info! From the linked issues it is clear to me that many people want to verify if an upload will succeed before actually uploading. If
|
No problem @mauvilsa! These are good (albeit nontrivial) suggestions; I've written some thoughts about each below.
I would happily review a change that clarifies the behavior of
You could open an issue on Warehouse to discuss this, but there are a handful of nontrivial dimensions to this: do "dry-run" uploads require the same auth as normal uploads? How does Warehouse notify people when a dry-run fails (not just a generic error code, but a structured, detailed message)? What guarantees do users have that their packages are not retained during the dry-run? And so forth -- I think these are all surmountable, but they need to be considered in sum.
This points to one of the challenges: PyPI is a single implementation of a handful of standards and informal standards. The upload API is one of those informal standards. If you want "dry running" to be a formal standard that works with uploads other than to PyPI, it needs to go through a PEP process that yields a spec that other upload-receiving indices (e.g. the various stacks provided by AWS, etc.) can feasibly implement. This in turn entails standardizing the upload endpoint itself. Again not insurmountable, but not trivial either!
This is a possibility, although it's worth noting that This may not be an issue, but just as an example of "no dry-run/check API will ever be 100% correct" 🙂 |
There's no way for twine to fail for all of the reasons PyPI might fail not least of all because no one can guarantee that between today when we released 6.1 and tomorrow a new validation won't be added to PyPI. To try to constantly keep up with them in both projects is almost needless toil. We'd like to catch more problems for users but we'll never catch them all. |
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 addedtwine check
in 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 check
being "Checks whether your distribution’s long description will render correctly on PyPI". On one hand, not great that when I runtwine check --help
there is no such description. On the other hand, it seems quite misleading thatcheck
is only for "long description". I don't know if the original idea was to extendcheck
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:
For reference, this relates to google/jsonnet#1172.
The text was updated successfully, but these errors were encountered: