Does twine treat long_description as a mandatory field?
Your Environment
- Your operating system:
Originally caught on GitHub Actions Publish to PyPI, but locally repro'd on my OSX laptop.
- Version of python you are running:
3.10.8
- How did you install twine? Did you use your operating system's package manager or pip or something else?
pip install twine
- Version of twine you have installed (include complete output of):
twine --version
4.0.2
- Which package repository are you targeting?
PyPI
If you're having issues uploading a specific package, you must include a copy of the following:
- The package's
PKG-INFOfile
The Issue
I noticed today that my Github action to publish to pypi started failing with
ERROR `long_description` has syntax errors in markup and would not be rendered on PyPI.
No content rendered from RST source.
This was confusing for me because
- It had been working and hadn't been changed for a very long time.
- setup.cfg does not have a long_description
- setup.py does not have a long_description
- and the PKG-INFO in my built dist/ folder (attached) does not have a long_description.
After coming across https://github.com/pypa/twine/issues/454, I tried to repro the issue locally and was able to do so:
Steps to Reproduce
I am able to reproduce this locally using the config mentioned above.
- Clone lyft/cartography at 36c6ed3
- Build my project with
python -m build --sdist --wheel --outdir dist/ . - Run twine 4.0.2 against dist with
twine check dist/*.
Steps I took to fix:
I added a long_description field to setup.py and twine check now passes:

Questions
- Is
long_descriptiona mandatory field? - If so, would it be possible to adjust the error message so that it says
long_descriptionis mandatory, instead of saying that "long_descriptionhas syntax errors"?
Thank you for your time! Please let me know if I missed something silly in my own configs.
At first glance, I think this might be a duplicate of https://github.com/pypa/twine/issues/908 (which I spent some time digging into, but needs more investigation).
- Is
long_descriptiona mandatory field?
According to the spec, it is not.
Concur this issue is essentially the same as #908.