summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2021-05-02 21:03:40 (GMT)
committerGitHub <noreply@github.com>2021-05-02 21:03:40 (GMT)
commit37e0c7850de902179b28f1378fbbc38a5ed3628c (patch)
treeecc352d5d7eaf99485bc4c2735d2a5f14f532084 /Doc/library
parent0ad1e0384c8afc5259a6d03363491d89500a5d03 (diff)
downloadcpython-37e0c7850de902179b28f1378fbbc38a5ed3628c.zip
cpython-37e0c7850de902179b28f1378fbbc38a5ed3628c.tar.gz
cpython-37e0c7850de902179b28f1378fbbc38a5ed3628c.tar.bz2
bpo-43926: Cleaner metadata with PEP 566 JSON support. (GH-25565)
* bpo-43926: Cleaner metadata with PEP 566 JSON support. * Add blurb * Add versionchanged and versionadded declarations for changes to metadata. * Use descriptor for PEP 566
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/importlib.metadata.rst13
1 files changed, 13 insertions, 0 deletions
diff --git a/Doc/library/importlib.metadata.rst b/Doc/library/importlib.metadata.rst
index 40e48d1..9bedee5 100644
--- a/Doc/library/importlib.metadata.rst
+++ b/Doc/library/importlib.metadata.rst
@@ -170,6 +170,19 @@ the values are returned unparsed from the distribution metadata::
>>> wheel_metadata['Requires-Python'] # doctest: +SKIP
'>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*'
+``PackageMetadata`` also presents a ``json`` attribute that returns
+all the metadata in a JSON-compatible form per :PEP:`566`::
+
+ >>> wheel_metadata.json['requires_python']
+ '>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*'
+
+.. versionchanged:: 3.10
+ The ``Description`` is now included in the metadata when presented
+ through the payload. Line continuation characters have been removed.
+
+.. versionadded:: 3.10
+ The ``json`` attribute was added.
+
.. _version: