Skip to content

Commit

Permalink
Remove License-Expression field
Browse files Browse the repository at this point in the history
  • Loading branch information
cdce8p committed Jan 9, 2025
1 parent c891ff0 commit e42c5c4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion newsfragments/4706.feature.rst
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Added initial support for ``License-Expression`` (`PEP 639 <https://peps.python.org/pep-0639/#add-license-expression-field>`_). -- by :user:`cdce8p`
Added initial support for license expression (`PEP 639 <https://peps.python.org/pep-0639/#add-license-expression-field>`_). -- by :user:`cdce8p`
9 changes: 3 additions & 6 deletions setuptools/_core_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,9 @@ def write_field(key, value):
if attr_val is not None:
write_field(field, attr_val)

if self.license_expression:
write_field('License-Expression', rfc822_escape(self.license_expression))
else:
license = self.get_license()
if license:
write_field('License', rfc822_escape(license))
license = self.license_expression or self.get_license()
if license:
write_field('License', rfc822_escape(license))

for label, url in self.project_urls.items():
write_field('Project-URL', f'{label}, {url}')
Expand Down
2 changes: 1 addition & 1 deletion setuptools/tests/config/test_apply_pyprojecttoml.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ def test_utf8_maintainer_in_metadata( # issue-3663
PEP639_LICENSE_EXPRESSION,
None,
'MIT OR Apache-2.0',
'License-Expression: MIT OR Apache-2.0',
'License: MIT OR Apache-2.0', # TODO Metadata version '2.4'
id='license-expression',
),
),
Expand Down

0 comments on commit e42c5c4

Please sign in to comment.