-
Notifications
You must be signed in to change notification settings - Fork 308
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
Empty body of METADATA results into an error when twine check
#908
Comments
twine check
I did some experimenting with an example package. It looks like the I was able to reproduce the error using a wheel:
However, I'm not seeing the same behavior from the sdist:
Here's the relevant configuration: https://github.com/bhrutledge/example-pkg-bhrutledge/blob/missing-description/pyproject.toml The warnings are what I would expect, given the missing --- example-pkg-bhrutledge-0.0.5/PKG-INFO 2022-06-23 08:18:59.000000000 -0400
+++ example_pkg_bhrutledge-0.0.5.dist-info/METADATA 2022-06-23 12:22:08.000000000 -0400
@@ -12,3 +12,4 @@
Requires-Python: >=3.6
Description-Content-Type: text/rst
License-File: LICENSE
+ I wonder if that's what's tripping up Twine (or readme_renderer under the hood), though I'm also seeing the same error with backends other than setuptools (e.g. hatchling and flit) that don't seem to add an extra line. Need to investigate further. |
@bhrutledge One difference I found from reading the scenario:
|
Multiple things failed at once: 1. Link to readme was lost during conversion to `pyproject.toml` in f668317. This commit restores it. 2. PyPI only accepts rst/markdown/txt, so convert README back to markdown 3. twine has a bug that prevents upload from working without readme: pypa/twine#908 Also run `twine check` on CI to detect `pyproject.toml` metadata errors earlier
Multiple things failed at once: 1. Link to readme was lost during conversion to `pyproject.toml` in f668317. This commit restores it. 2. PyPI only accepts rst/markdown/txt, so convert README back to markdown 3. twine has a bug that prevents upload from working without readme: pypa/twine#908 Also run `twine check` on CI to detect `pyproject.toml` metadata errors earlier
Multiple things failed at once: 1. Link to readme was lost during conversion to `pyproject.toml` in f668317. This commit restores it. 2. PyPI only accepts rst/markdown/txt, so undo conversion of readme to AsciiDoc that was done in 55191a7 3. twine has a bug that prevents upload from working without readme: pypa/twine#908 Also run `twine check` on CI to detect `pyproject.toml` metadata errors earlier
Multiple things failed at once: 1. Link to readme was lost during conversion to `pyproject.toml` in f668317. This commit restores it. 2. PyPI only accepts rst/markdown/txt, so undo conversion of readme to AsciiDoc that was done in 55191a7 3. twine has a bug that prevents upload from working without readme: pypa/twine#908 Also run `twine check` on CI to detect `pyproject.toml` metadata errors earlier
Multiple things failed at once: 1. Link to readme was lost during conversion to `pyproject.toml` in f668317. This commit restores it. 2. PyPI only accepts rst/markdown/txt, so undo conversion of readme to AsciiDoc that was done in 55191a7 3. twine has a bug that prevents upload from working without readme: pypa/twine#908 Also run `twine check` on CI to detect `pyproject.toml` metadata errors earlier
twine (the tool we use to upload packages to PyPI) is currently failing if the long_description (used to render a project's page on PyPI website) is not set. Somehow it complains that it is not well formatted reStructuredText, but it's simply empty... This looks like a bug, or bad interaction between twince and setuptools, because the field is technically optional. Also see pypa/twine#960 and pypa/twine#908. This issue is currently preventing the upload of newly built Brotli v1.1.0 Python wheels to PyPI: google/brotli-wheels#18 (comment) Anyway, we may well set the long_description to the content of the README.md file, as it's customary for python projects.
twine (the tool we use to upload packages to PyPI) is currently failing if the long_description (used to render a project's page on PyPI website) is not set. Somehow it complains that it is not well formatted reStructuredText, but it's simply empty... This looks like a bug, or bad interaction between twince and setuptools, because the field is technically optional. Also see pypa/twine#960 and pypa/twine#908. This issue is currently preventing the upload of newly built Brotli v1.1.0 Python wheels to PyPI: google/brotli-wheels#18 (comment) Anyway, we may well set the long_description to the content of the README.md file, as it's customary for python projects.
+1; I encountered this issue also today when attempting to check a package with minimal metadata. According to the spec, only |
The explicit purpose of check is to verify the long description renders without errors on PyPI. It does almost nothing else. |
Sorry to bump this issue. I had the same issue today in one of my runs. Breadcrumb
BugIf the description is empty, the If we go back at Lines 99 to 106 in ded15b9
from twine.commands.check import _RENDERERS
renderer = _RENDERERS.get("text/x-rst")
assert renderer.render("") is None |
Your Environment
twine version is 4.0.1 (install from pip)
python version is 3.10.5 (install by system package manager)
linux (arch linux)
The Issue
I create a wheel file with cibuildwheel(https://github.com/pypa/cibuildwheel), in which METADATA has an empty body like
old version cibuildwheel does not leave body empty, and add a word "UNKNOWN" like:
With wheel file created with new version cibuildwheel,
twien check
failed with message:Steps to Reproduce
Just delete the description body of package can reproduce.
I also post an issue at pypa/cibuildwheel#1131 but it seems it is not their fault.
because https://peps.python.org/pep-0566/#description saying
It may be provided, so not to do so should be permitted.
The text was updated successfully, but these errors were encountered: