Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop writing License-File #4771

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions newsfragments/4771.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Stop writing ``License-File`` to metadata, since setuptools does not yet support Metadata 2.4
2 changes: 1 addition & 1 deletion setuptools/_core_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
7 changes: 4 additions & 3 deletions setuptools/tests/test_egg_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down
Loading