Browse Source

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
Jeremy Stanley 1 year ago
parent
commit
538d2c21a1
4 changed files with 5 additions and 1 deletions
  1. 2
    1
      doc/source/user/using.rst
  2. 1
    0
      pbr/tests/testpackage/setup.cfg
  3. 1
    0
      pbr/util.py
  4. 1
    0
      setup.cfg

+ 2
- 1
doc/source/user/using.rst View File

@@ -50,7 +50,8 @@ itself):
50 50
     author = OpenStack Foundation
51 51
     author-email = openstack-dev@lists.openstack.org
52 52
     summary = OpenStack's setup automation in a reusable form
53
-    description-file = README
53
+    description-file = README.rst
54
+    description-content-type = text/x-rst; charset=UTF-8
54 55
     home-page = https://launchpad.net/pbr
55 56
     license = Apache-2
56 57
     classifier =

+ 1
- 0
pbr/tests/testpackage/setup.cfg View File

@@ -10,6 +10,7 @@ summary = Test package for testing pbr
10 10
 description-file =
11 11
     README.txt
12 12
     CHANGES.txt
13
+description-content-type = text/plain; charset=UTF-8
13 14
 requires-python = >=2.5
14 15
 
15 16
 requires-dist =

+ 1
- 0
pbr/util.py View File

@@ -104,6 +104,7 @@ D1_D2_SETUP_ARGS = {
104 104
     "description": ("metadata", "summary"),
105 105
     "keywords": ("metadata",),
106 106
     "long_description": ("metadata", "description"),
107
+    "long_description_content_type": ("metadata", "description_content_type"),
107 108
     "download_url": ("metadata",),
108 109
     "classifiers": ("metadata", "classifier"),
109 110
     "platforms": ("metadata", "platform"),  # **

+ 1
- 0
setup.cfg View File

@@ -5,6 +5,7 @@ author-email = openstack-dev@lists.openstack.org
5 5
 summary = Python Build Reasonableness
6 6
 description-file =
7 7
     README.rst
8
+description-content-type = text/x-rst; charset=UTF-8
8 9
 home-page = https://docs.openstack.org/pbr/latest/
9 10
 requires-python = >=2.6
10 11
 classifier =

Loading…
Cancel
Save