Skip to content

Commit 4fcc31d

Browse files
diagronholm
authored andcommitted
Metadata 2.1 updates (#232)
Updated metadata version to 2.1 and dropped DESCRIPTION.rst from the list of created files.
1 parent 27f3273 commit 4fcc31d

File tree

5 files changed

+9
-14
lines changed

5 files changed

+9
-14
lines changed

CHANGES.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ Unreleased
33
- Fixed displaying of errors on Python 3
44
- Fixed single digit versions in wheel files not being properly recognized
55
- Enabled Zip64 support in wheels by default
6+
- Metadata-Version is now 2.1
7+
- Don't create a DESCRIPTION.RST anymore.
68

79
0.30.0
810
======

tests/pydist-schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "http://www.python.org/dev/peps/pep-0426/",
33
"$schema": "http://json-schema.org/draft-04/schema#",
4-
"title": "Metadata for Python Software Packages 2.0",
4+
"title": "Metadata for Python Software Packages 2.1",
55
"type": "object",
66
"properties": {
77
"metadata_version": {

tests/test_pkginfo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
def test_pkginfo_mangle_from(tmpdir):
77
"""Test that write_pkginfo() will not prepend a ">" to a line starting with "From"."""
88
metadata = """\
9-
Metadata-Version: 2.0
9+
Metadata-Version: 2.1
1010
Name: foo
1111
1212
From blahblah

wheel/bdist_wheel.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -426,14 +426,8 @@ def adios(p):
426426
distribution=self.distribution)
427427

428428
if 'description' in pymeta:
429-
description_filename = 'DESCRIPTION.rst'
430-
description_text = pymeta.pop('description')
431-
description_path = os.path.join(distinfo_path,
432-
description_filename)
433-
with open(description_path, "wb") as description_file:
434-
description_file.write(description_text.encode('utf-8'))
435-
pymeta['extensions']['python.details']['document_names']['description'] = \
436-
description_filename
429+
# Don't include `description` in JSON metadata
430+
pymeta.pop('description')
437431

438432
# XXX heuristically copy any LICENSE/LICENSE.txt?
439433
license = self.license_file()

wheel/metadata.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from .pkginfo import read_pkg_info
1515
from .util import OrderedDefaultDict
1616

17-
METADATA_VERSION = "2.0"
17+
METADATA_VERSION = "2.1"
1818

1919
PLURAL_FIELDS = {"classifier": "classifiers",
2020
"provides_dist": "provides",
@@ -265,11 +265,10 @@ def generate_requirements(extras_require):
265265

266266
def pkginfo_to_metadata(egg_info_path, pkginfo_path):
267267
"""
268-
Convert .egg-info directory with PKG-INFO to the Metadata 1.3 aka
269-
old-draft Metadata 2.0 format.
268+
Convert .egg-info directory with PKG-INFO to the Metadata 2.1 format
270269
"""
271270
pkg_info = read_pkg_info(pkginfo_path)
272-
pkg_info.replace_header('Metadata-Version', '2.0')
271+
pkg_info.replace_header('Metadata-Version', '2.1')
273272
requires_path = os.path.join(egg_info_path, 'requires.txt')
274273
if os.path.exists(requires_path):
275274
with open(requires_path) as requires_file:

0 commit comments

Comments
 (0)