pypa / readme_renderer

Safely render long_description/README files in Warehouse
Apache License 2.0
158 stars 88 forks source link

Upload rejected due to failure to render description #178

Closed KenKundert closed 1 year ago

KenKundert commented 3 years ago

When uploading the latest version of nestedtext, the upload was rejected due to a failure to render the description even though twine check passed.

% py setup.py sdist bdist_wheel
running sdist
   ...
adding 'nestedtext.py'
adding 'nestedtext-1.2.0.dist-info/LICENSE'
adding 'nestedtext-1.2.0.dist-info/METADATA'
adding 'nestedtext-1.2.0.dist-info/WHEEL'
adding 'nestedtext-1.2.0.dist-info/top_level.txt'
adding 'nestedtext-1.2.0.dist-info/RECORD'
removing build/bdist.linux-x86_64/wheel
% twine check  dist/*                                                       
Checking dist/nestedtext-1.2.0-py3-none-any.whl: PASSED
Checking dist/nestedtext-1.2.0.tar.gz: PASSED
% twine upload dist/*                                                       
Uploading distributions to https://upload.pypi.org/legacy/
Uploading nestedtext-1.2.0-py3-none-any.whl
100%|█████████████████████████████████████████████████████| 25.1k/25.1k [00:00<00:00, 27.6kB/s]
NOTE: Try --verbose to see response content.
HTTPError: 400 Bad Request from https://upload.pypi.org/legacy/
The description failed to render for 'text/x-rst'. See https://pypi.org/help/#description-content-type for more information.

The README file is restructuredtext, and _long_description_contenttype = 'text/x-rst'. Finally, I have run _readmerenderer on the README.rst file without there being a report of any issues.

I am at a loss as to what to do next. I think the problem is on your end, but I am not sure.

KenKundert commented 3 years ago

Okay, I have figured this out. The problem was the following lines in the README.rst file:

.. code-block:: nestedtext

nestedtext is a format that has been submitted to pygments but has yet to be accepted and supported. Most renderers will ignore the nestedtext tag if it is unknown, but apparently your renderer is a bit more sensitive.

As far as I am concerned this issue can be closed. I will leave it open for now in case you want to use it as a reminder to make it so that twine check reports this error.

di commented 3 years ago

Twine uses the same rendere that PyPI uses, I would expect this to have the same behavior in both cases. Transferring to readme_renderer's tracker to investigate why this happened.

miketheman commented 1 year ago

I recently added a test to confirm that RST would continue to render despite an unknown code block directive: https://github.com/pypa/readme_renderer/pull/256

Closing!