Skip to content

Commit

Permalink
build: Teach twine that our README.md is in Markdown
Browse files Browse the repository at this point in the history
Right now, `twine` complains that our README’s Markdown is improperly formatted
as ReStructuredText.  This patch tells it explicitly that the README is
formatted in GitHub Flavored Markdown, by reading the `README.md` file into the
`long_description` field explicitly and then explicitly selecting the correct
content type.

Signed-off-by: Patrick M. Niedzielski <[email protected]>
  • Loading branch information
pniedzielski committed Feb 22, 2024
1 parent 36b07bc commit 180aa64
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import platform
import sys

from pathlib import Path
import pkgconfig
from setuptools import Extension
from setuptools import setup
Expand Down Expand Up @@ -181,6 +182,10 @@ def create_extension(name, libraries, **kwargs):
with open("src/blazingmq/_about.py") as fp:
exec(fp.read(), about)

# Read the contents of the README file.
this_directory = Path(__file__).parent
long_description = (this_directory / "README.md").read_text()

setup(
name="blazingmq",
description="Python BlazingMQ API",
Expand All @@ -204,6 +209,8 @@ def create_extension(name, libraries, **kwargs):
package_data={"blazingmq": ["py.typed", "_ext.pyi"]},
package_dir={"": "src"},
packages=["blazingmq"],
long_description=long_description,
long_description_content_type="text/markdown",
ext_modules=cythonize(
EXTENSIONS,
include_path=["src/declarations"],
Expand Down

0 comments on commit 180aa64

Please sign in to comment.