mitodl / django-server-status

Monitor server status for health checks.
GNU Affero General Public License v3.0
8 stars 0 forks source link

Fix description handling for packaging #43

Closed noisecapella closed 4 years ago

noisecapella commented 4 years ago

When we tried to upload this package to pypi, we got this error:

Checking dist/django_server_status-0.7.1-py3-none-any.whl: FAILED
  `long_description` has syntax errors in markup and would not be rendered on PyPI.
    line 6: Error: Unexpected indentation.
  warning: `long_description_content_type` missing. defaulting to `text/x-rst`.
Checking dist/django-server-status-0.7.1.tar.gz: FAILED
  `long_description` has syntax errors in markup and would not be rendered on PyPI.
    line 6: Error: Unexpected indentation.
  warning: `long_description_content_type` missing. defaulting to `text/x-rst`.

The problem is that newlines in the description field is not handled properly by the packaging tool. The line 6 part is misleading above. README.rst is valid restructured text but the METADATA of the wheel looks like this:

Screenshot from 2020-09-18 10-14-45

line 6 refers to the indentation within the METADATA file, not the README.rst file. From the docs it looks like Metadata format 1.1 was agnostic on this but Metadata 2.1 specifically requires newlines to have 7 spaces and a | after each newline character. This attempts to fix the issue by handling this in the setup.py file.

shaidar commented 4 years ago

👍