Skip to content

Commit c825f3e

Browse files
committed
Remove License-Expression field
1 parent 7247772 commit c825f3e

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

newsfragments/4706.feature.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Added initial support for ``License-Expression`` (`PEP 639 <https://peps.python.org/pep-0639/#add-license-expression-field>`_). -- by :user:`cdce8p`
1+
Added initial support for license expression (`PEP 639 <https://peps.python.org/pep-0639/#add-license-expression-field>`_). -- by :user:`cdce8p`

setuptools/_core_metadata.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -176,12 +176,9 @@ def write_field(key, value):
176176
if attr_val is not None:
177177
write_field(field, attr_val)
178178

179-
if self.license_expression:
180-
write_field('License-Expression', rfc822_escape(self.license_expression))
181-
else:
182-
license = self.get_license()
183-
if license:
184-
write_field('License', rfc822_escape(license))
179+
license = self.license_expression or self.get_license()
180+
if license:
181+
write_field('License', rfc822_escape(license))
185182

186183
for label, url in self.project_urls.items():
187184
write_field('Project-URL', f'{label}, {url}')

setuptools/tests/config/test_apply_pyprojecttoml.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ def test_utf8_maintainer_in_metadata( # issue-3663
290290
PEP639_LICENSE_EXPRESSION,
291291
None,
292292
'MIT OR Apache-2.0',
293-
'License-Expression: MIT OR Apache-2.0',
293+
'License: MIT OR Apache-2.0', # TODO Metadata version '2.4'
294294
id='license-expression',
295295
),
296296
),

0 commit comments

Comments
 (0)