From 538d2c21a1e2c816aa4ec2b20550c1278707456a Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Mon, 20 Nov 2017 20:43:36 +0000 Subject: [PATCH] Support Description-Content-Type metadata As of setuptools 36.4.0, support for Description-Content-Type metadata was added via the long_description_content_type variable. Add a metadata.description-content-type option for setup.cfg so it can be provided through PBR. This makes it possible to instruct PyPI and potentially other frontends to know an explicit RFC 1341 content type, along with character set and variant, for the accompanying long description. Change-Id: I852f603d9ca4e4cd469eab4cae9933ef2581e3af --- doc/source/user/using.rst | 3 ++- pbr/tests/testpackage/setup.cfg | 1 + pbr/util.py | 1 + setup.cfg | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/source/user/using.rst b/doc/source/user/using.rst index 4b08ec4e..0b911411 100644 --- a/doc/source/user/using.rst +++ b/doc/source/user/using.rst @@ -50,7 +50,8 @@ itself): author = OpenStack Foundation author-email = openstack-dev@lists.openstack.org summary = OpenStack's setup automation in a reusable form - description-file = README + description-file = README.rst + description-content-type = text/x-rst; charset=UTF-8 home-page = https://launchpad.net/pbr license = Apache-2 classifier = diff --git a/pbr/tests/testpackage/setup.cfg b/pbr/tests/testpackage/setup.cfg index d10a87e9..5af15149 100644 --- a/pbr/tests/testpackage/setup.cfg +++ b/pbr/tests/testpackage/setup.cfg @@ -10,6 +10,7 @@ summary = Test package for testing pbr description-file = README.txt CHANGES.txt +description-content-type = text/plain; charset=UTF-8 requires-python = >=2.5 requires-dist = diff --git a/pbr/util.py b/pbr/util.py index dc8995ea..ef4deb01 100644 --- a/pbr/util.py +++ b/pbr/util.py @@ -104,6 +104,7 @@ D1_D2_SETUP_ARGS = { "description": ("metadata", "summary"), "keywords": ("metadata",), "long_description": ("metadata", "description"), + "long_description_content_type": ("metadata", "description_content_type"), "download_url": ("metadata",), "classifiers": ("metadata", "classifier"), "platforms": ("metadata", "platform"), # ** diff --git a/setup.cfg b/setup.cfg index 35f0d729..d2d85261 100644 --- a/setup.cfg +++ b/setup.cfg @@ -5,6 +5,7 @@ author-email = openstack-dev@lists.openstack.org summary = Python Build Reasonableness description-file = README.rst +description-content-type = text/x-rst; charset=UTF-8 home-page = https://docs.openstack.org/pbr/latest/ requires-python = >=2.6 classifier =