diff options
| author | Dustin Ingram <di@users.noreply.github.com> | 2018-03-21 13:42:54 -0500 |
|---|---|---|
| committer | Alex Grönholm <alex.gronholm@nextday.fi> | 2018-03-21 20:42:54 +0200 |
| commit | 4fcc31d12b6cde517674a19077f89e740bf4c69f (patch) | |
| tree | 95c7eb6cbb34dfe85360b91a1e6b46d3de7a2b6b | |
| parent | 27f3273bf79ed9ba412a13976bbe1077d3d060a4 (diff) | |
| download | wheel-git-4fcc31d12b6cde517674a19077f89e740bf4c69f.tar.gz | |
Metadata 2.1 updates (#232)
Updated metadata version to 2.1 and dropped DESCRIPTION.rst from the list of created files.
| -rw-r--r-- | CHANGES.txt | 2 | ||||
| -rw-r--r-- | tests/pydist-schema.json | 2 | ||||
| -rw-r--r-- | tests/test_pkginfo.py | 2 | ||||
| -rw-r--r-- | wheel/bdist_wheel.py | 10 | ||||
| -rw-r--r-- | wheel/metadata.py | 7 |
5 files changed, 9 insertions, 14 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index 8bd9578..5043217 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -3,6 +3,8 @@ Unreleased - Fixed displaying of errors on Python 3 - Fixed single digit versions in wheel files not being properly recognized - Enabled Zip64 support in wheels by default +- Metadata-Version is now 2.1 +- Don't create a DESCRIPTION.RST anymore. 0.30.0 ====== diff --git a/tests/pydist-schema.json b/tests/pydist-schema.json index be650ef..1a22041 100644 --- a/tests/pydist-schema.json +++ b/tests/pydist-schema.json @@ -1,7 +1,7 @@ { "id": "http://www.python.org/dev/peps/pep-0426/", "$schema": "http://json-schema.org/draft-04/schema#", - "title": "Metadata for Python Software Packages 2.0", + "title": "Metadata for Python Software Packages 2.1", "type": "object", "properties": { "metadata_version": { diff --git a/tests/test_pkginfo.py b/tests/test_pkginfo.py index 511a9b8..a7e07a8 100644 --- a/tests/test_pkginfo.py +++ b/tests/test_pkginfo.py @@ -6,7 +6,7 @@ from wheel.pkginfo import write_pkg_info def test_pkginfo_mangle_from(tmpdir): """Test that write_pkginfo() will not prepend a ">" to a line starting with "From".""" metadata = """\ -Metadata-Version: 2.0 +Metadata-Version: 2.1 Name: foo From blahblah diff --git a/wheel/bdist_wheel.py b/wheel/bdist_wheel.py index 33d40fa..81b5915 100644 --- a/wheel/bdist_wheel.py +++ b/wheel/bdist_wheel.py @@ -426,14 +426,8 @@ class bdist_wheel(Command): distribution=self.distribution) if 'description' in pymeta: - description_filename = 'DESCRIPTION.rst' - description_text = pymeta.pop('description') - description_path = os.path.join(distinfo_path, - description_filename) - with open(description_path, "wb") as description_file: - description_file.write(description_text.encode('utf-8')) - pymeta['extensions']['python.details']['document_names']['description'] = \ - description_filename + # Don't include `description` in JSON metadata + pymeta.pop('description') # XXX heuristically copy any LICENSE/LICENSE.txt? license = self.license_file() diff --git a/wheel/metadata.py b/wheel/metadata.py index 75dce67..6c29edd 100644 --- a/wheel/metadata.py +++ b/wheel/metadata.py @@ -14,7 +14,7 @@ from . import __version__ as wheel_version from .pkginfo import read_pkg_info from .util import OrderedDefaultDict -METADATA_VERSION = "2.0" +METADATA_VERSION = "2.1" PLURAL_FIELDS = {"classifier": "classifiers", "provides_dist": "provides", @@ -265,11 +265,10 @@ def generate_requirements(extras_require): def pkginfo_to_metadata(egg_info_path, pkginfo_path): """ - Convert .egg-info directory with PKG-INFO to the Metadata 1.3 aka - old-draft Metadata 2.0 format. + Convert .egg-info directory with PKG-INFO to the Metadata 2.1 format """ pkg_info = read_pkg_info(pkginfo_path) - pkg_info.replace_header('Metadata-Version', '2.0') + pkg_info.replace_header('Metadata-Version', '2.1') requires_path = os.path.join(egg_info_path, 'requires.txt') if os.path.exists(requires_path): with open(requires_path) as requires_file: |
