Skip to content

Commit

Permalink
setup.py: add long_description (#1073)
Browse files Browse the repository at this point in the history
twine (the tool we use to upload packages to PyPI) is currently failing if the long_description (used to render a project's page on PyPI website) is not set. Somehow it complains that it is not well formatted reStructuredText, but it's simply empty...
This looks like a bug, or bad interaction between twince and setuptools, because the field is technically optional.
Also see pypa/twine#960 and pypa/twine#908.

This issue is currently preventing the upload of newly built Brotli v1.1.0 Python wheels to PyPI:
google/brotli-wheels#18 (comment)

Anyway, we may well set the long_description to the content of the README.md file, as it's customary for python projects.
  • Loading branch information
anthrotype authored Sep 7, 2023
1 parent ed738e8 commit 2ce8566
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,14 @@ def build_extension(self, ext):
'build_ext': BuildExt,
}

with open("README.md", "r") as f:
README = f.read()

setup(
name=NAME,
description=DESCRIPTION,
long_description=README,
long_description_content_type="text/markdown",
version=VERSION,
url=URL,
author=AUTHOR,
Expand Down

0 comments on commit 2ce8566

Please sign in to comment.