PyPI packages uploaded to package registry have undocumented limit on description length
Summary
- PyPI packages with descriptions longer than 4000 chars fail to upload to the package registry.
- This limit doesn't seem to be documented anywhere.
- This limit is very easy to hit or exceed since package descriptions typically contain the project entire README file (Ref: https://python-poetry.org/docs/pyproject/#readme)
- PyPI.org does not enforce a similar limit.
Steps to reproduce
Build and attempt to upload a PyPI package with a readme longer than 4000 chars.
Example Project
Example: https://gitlab.com/thelabnyc/django-oscar/django-oscar-bluelight/-/blob/master/server/pyproject.toml
- CI job which failed due to this limit: https://gitlab.com/thelabnyc/django-oscar/django-oscar-bluelight/-/jobs/5545630647.
- Notice how just prior to failing to upload to the Gitlab registry, the PyPI.org upload of the same pkg binary worked fine.
What is the current bug behavior?
The twine upload fails with this reponse:
{"message":"Validation failed: Description is too long (maximum is 4000 characters)"}
What is the expected correct behavior?
Gitlab package registry should allow long descriptions of packages.
Relevant logs and/or screenshots
Output of checks
This bug happens on GitLab.com
Possible fixes
Increase description length limit to match behavior of PyPI.org—either no limit, or at least long enough to allow the average-length README.
