Skip to content

Commit 97e8f94

Browse files
committed
Remove License-Expression field
1 parent a3fe92a commit 97e8f94

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
@@ -175,12 +175,9 @@ def write_field(key, value):
175175
if attr_val is not None:
176176
write_field(field, attr_val)
177177

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

185182
for project_url in self.project_urls.items():
186183
write_field('Project-URL', '%s, %s' % project_url)

setuptools/tests/config/test_apply_pyprojecttoml.py

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

0 commit comments

Comments
 (0)