warehouse: long_description_content_type=text/markdown doesn't always work
This page does not show correctly rendered markdown: https://pypi.org/project/datasette/

The setup.py file looks like this:
https://github.com/simonw/datasette/blob/fb988ace7c7e2bee5ac142a0eab22431d0675a77/setup.py#L13-L18
setup(
name='datasette',
description='An instant JSON API for your SQLite databases',
long_description=get_long_description(),
long_description_content_type='text/markdown',
author='Simon Willison',
According to @ambv on Twitter this is caused by a bug: https://twitter.com/llanga/status/984866099886895104 “There’s a bug now where you need to upload just the tar.gz first with Twine and only then upload the rest of the files.”
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 3
- Comments: 27 (10 by maintainers)
Commits related to this issue
- Fix pypi readme rendering As per https://github.com/pypa/warehouse/issues/3664 Signed-off-by: Sylvain Hellegouarch <sh@defuze.org> — committed to chaostoolkit/chaostoolkit by Lawouach 6 years ago
- Add pyproject.toml for build system dependencies The intention is to provide requirements for the Python installer. There are features in the setup process which require specific setuptools, wheels a... — committed to heilaaks/snippy by heilaaks 6 years ago
- fix: markdown description bug https://github.com/pypa/warehouse/issues/3664 https://github.com/pypa/twine/issues/425 — committed to Sieboldianus/lbsntransform by Sieboldianus 5 years ago
- remove license field newlines in https://www.gnu.org/licenses/gpl-3.0.txt was causing description failed to render error https://github.com/pypa/warehouse/issues/3664#issuecomment-552218625 http... — committed to wesinator/domainbigdata-python by wesinator 5 years ago
- add files for setup / pip (#4) * add files for setup / pip #2 * remove license field newlines in https://www.gnu.org/licenses/gpl-3.0.txt was causing description failed to render error ... — committed to wesinator/domainbigdata-python by wesinator 5 years ago
@scruffystuffs Looking at the metadata of the source distribution of your package, it has Windows-style line endings in the
Description, so it looks like you’ve having the same issue as https://github.com/pypa/setuptools/issues/1440Apparently
python setup.py sdist uploadis the problem. I will open a new issue about the fact that it’s extremely non-obvious that you have to use “twine”. (I know there’s documentation that says so… but it’s not the documentation that’s linked to when you’re looking for how to set your project description.)Yep, this is due to building with an old version of
wheelwhich incorrectly sets theMetadata-Versionfield. Should be fixed by apip install wheel==0.31.0and then building/uploading a new distribution.This problem is still occurring when running
python setup.py sdist bdist_wheelandtwine uploadfrom a windows machine.Tested ubuntu 18.04 and windows 10. Ubuntu uploads everything fine, but running the exact same commands from a windows machine causes the above issue to appear with the exact same files.
setuptools, wheel, and twine are all at or beyond the levels specified in the above comments, and are at the same level for both machines.
That worked - I ran
pip install wheel==0.31.0before doingpython setup.py bdist_wheeland the result was this page with the markdown correctly formatted: https://pypi.org/project/datasette/running into similar issues with my team for relative links
Uploaded two example cases to test.pypi.org.
Uploaded from Windows Uploaded from Ubuntu
The files for these distributions should be identical, other than the version number, yet they render entirely differently on the project page.
If any more info is needed, let me know and I will be happy to provide it.
To clarify something: I’m not claiming that PyPI is linking to the Python documentation. PyPI links to packaging.python.org, of course. However, one way that people learn about PyPI in the first place is the Python documentation, where PyPI is described as that place that
setup.py uploaduploads to.If you want to update people’s understanding about how to upload Python packages, talking about it on your own blog and mentioning Twine twice on a very long documentation page isn’t enough. You need to make getting the new tools part of the new PyPI user experience.
@di Updating setuptools did the trick! Thanks for the quick reply and so much for the PyPI update!
@rspeer You can use the https://test.pypi.org/ instance to test as well … (and delete tags later or re-try)