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 Nov 25, 2024
1 parent a3fe92a commit 97e8f94
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 @@ -175,12 +175,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 project_url in self.project_urls.items():
write_field('Project-URL', '%s, %s' % project_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 @@ -289,7 +289,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 97e8f94

Please sign in to comment.