diff --git a/newsfragments/4771.bugfix.rst b/newsfragments/4771.bugfix.rst new file mode 100644 index 0000000000..6a879245b7 --- /dev/null +++ b/newsfragments/4771.bugfix.rst @@ -0,0 +1 @@ +Stop writing ``License-File`` to metadata, since setuptools does not yet support Metadata 2.4 diff --git a/setuptools/_core_metadata.py b/setuptools/_core_metadata.py index 2e9c48a77b..01e8de2418 100644 --- a/setuptools/_core_metadata.py +++ b/setuptools/_core_metadata.py @@ -204,7 +204,7 @@ def write_field(key, value): if self.long_description_content_type: write_field('Description-Content-Type', self.long_description_content_type) - self._write_list(file, 'License-File', self.license_files or []) + # self._write_list(file, 'License-File', self.license_files or []) _write_requirements(self, file) long_description = self.get_long_description() diff --git a/setuptools/tests/test_egg_info.py b/setuptools/tests/test_egg_info.py index a68ecaba4c..8f7358dc4a 100644 --- a/setuptools/tests/test_egg_info.py +++ b/setuptools/tests/test_egg_info.py @@ -1051,11 +1051,12 @@ def test_license_file_attr_pkg_info(self, tmpdir_cwd, env): line for line in pkg_info_lines if line.startswith('License-File:') ] + assert license_file_lines == [] # Only 'NOTICE', LICENSE-ABC', and 'LICENSE-XYZ' should have been matched # Also assert that order from license_files is keeped - assert "License-File: NOTICE" == license_file_lines[0] - assert "License-File: LICENSE-ABC" in license_file_lines[1:] - assert "License-File: LICENSE-XYZ" in license_file_lines[1:] + # assert "License-File: NOTICE" == license_file_lines[0] + # assert "License-File: LICENSE-ABC" in license_file_lines[1:] + # assert "License-File: LICENSE-XYZ" in license_file_lines[1:] def test_metadata_version(self, tmpdir_cwd, env): """Make sure latest metadata version is used by default."""