-
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
text/x-rst README analysis broken with the latest version (6.1.0) #1218
Comments
I assume the the metadata or the build process for If this is the case, I see where the problem is: in It should also be noted that serializing the |
Hi @dnicolodi. I was wrong when I provided the description of this error. I thought it was using Ubuntu 24.04, but is still using some old Ubuntu 20.04 VMs, thus the Python version is 3.8 and setuptools is 45.2.0-1. How should we use "description"? If I'm not wrong and according to [1], the "description" field should be one line only. The README file should be embedded in "long_description", right? |
For example, this is also failing in OpenStack Neutron. Here we are using:
E.g.: https://review.opendev.org/c/openstack/neutron/+/939806 |
That's a fairly old setuptools, and it explains why the metadata is generated the way it is.
Your project uses However, what matters is that twine was happy with your package metadata before, and it is not happy now. This needs to be fixed. |
Looking at the specification, it seems that setuptools is at fault here. The specification for the Description field is here https://packaging.python.org/en/latest/specifications/core-metadata/#description and it appears that setuptools is encoding it wrong: the continuation lines are prefixed by 7 spaces, but the pipe character is missing, cfg https://inspector.pypi.io/project/python-openstackclient/7.2.1/packages/5e/df/ffc770c88d551f1845411efa572a9657f65300e24a82c5a558c5139b86c3/python-openstackclient-7.2.1.tar.gz/python-openstackclient-7.2.1/PKG-INFO I guess a compatibility kludge for this setuptools non-standard behavior needs to be implemented. |
This is how def _collapse_leading_ws(header, txt):
"""
``Description`` header must preserve newlines; all others need not
"""
if header.lower() == 'description': # preserve newlines
return '\n'.join([x[8:] if x.startswith(' ' * 8) else x
for x in txt.strip().splitlines()])
else:
return ' '.join([x.strip() for x in txt.splitlines()]) Therefore it seems that |
Is there an existing issue for this?
What keywords did you use to search existing issues?
Since the release of twine 6.1.0, the parsing of the README files (format text/x-rst) fails in the OpenStack CI [1].
Error snippet: https://paste.opendev.org/show/bpIn5YiVeRrpNDMM06Ez/
Logs (of the snippet): https://04824dc10f811bf71cc7-f60cbd2bdbb8b5648c0b0982a5f4272f.ssl.cf1.rackcdn.com/939769/3/check/test-release-openstack/cd3a31f/job-output.txt
Source code from these logs: https://github.com/openstack/python-openstackclient
README file: https://raw.githubusercontent.com/openstack/python-openstackclient/refs/heads/master/README.rst
[1]https://zuul.opendev.org/t/openstack/builds?job_name=test-release-openstack&skip=0
What operating system are you using?
Linux
If you selected 'Other', describe your Operating System here
Ubuntu 24.04
What version of Python are you running?
Python 3.12
How did you install twine? Did you use your operating system's package manager or pip or something else?
What version of twine do you have installed (include the complete output)
Which package repository are you using?
pypi
Please describe the issue that you are experiencing
(already described)
Please list the steps required to reproduce this behaviour
Using the OpenStack CI. The steps are:
Anything else you'd like to mention?
No response
The text was updated successfully, but these errors were encountered: