You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Document warnings on how to set (long_)description #645
I have just spent >= 1 hour to overcome this bug: pypa/twine#454
In the description argument passed to setup(...), you must not pass newlines!
(Especially I passed __doc__, which starts of course with a newline most of the time.)
In the long_description argument passed to setup(...), you must use LF newlines (\n) exclusively. (No \n! No \r!)
I suggest doing
# Open readme with original (i.e. LF) newlines# to prevent the all too common "`long_description_content_type` missing"# bug (https://github.com/pypa/twine/issues/454)withopen('README.md', 'r', newline='', encoding='utf-8') asreadme_file:
long_description=readme_file.read()
long_description_content_type='text/markdown'setup(
# ...long_description=long_description,
long_description_content_type=long_description_content_type,
)
This issue is stale, and therefore I'll close it. The issue is no longer relevant, and the docs on this topic are better (e.g., #2146 documents the modern way to include one's README via pyproject.toml). Thanks for opening the issue @ComFreek
Activity
rgommers commentedon Nov 10, 2026
This issue is stale, and therefore I'll close it. The issue is no longer relevant, and the docs on this topic are better (e.g., #2146 documents the modern way to include one's
READMEviapyproject.toml). Thanks for opening the issue @ComFreek