Skip to content

Commit d86e496

Browse files
authored
Merge pull request #1458 from mprpic/fix-trove-classifier-mappings
fix(pkgmetadata): correct zlib and AGPL v3 classifier mappings
2 parents d16248a + 70ea355 commit d86e496

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

‎src/fromager/pkgmetadata/pep639.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,8 @@ def _license_text_to_spdx(text: str) -> LicenseExpression:
180180
"License :: OSI Approved :: European Union Public Licence 1.0 (EUPL 1.0)": "EUPL-1.0",
181181
"License :: OSI Approved :: European Union Public Licence 1.1 (EUPL 1.1)": "EUPL-1.1",
182182
"License :: OSI Approved :: European Union Public Licence 1.2 (EUPL 1.2)": "EUPL-1.2",
183-
"License :: OSI Approved :: GNU Affero General Public License v3": "AGPL-3.0-only",
183+
# ambiguous, see PEP 639
184+
"License :: OSI Approved :: GNU Affero General Public License v3": None,
184185
"License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)": "AGPL-3.0-or-later",
185186
# multiple versions
186187
"License :: OSI Approved :: GNU Free Documentation License (FDL)": None,
@@ -234,7 +235,8 @@ def _license_text_to_spdx(text: str) -> LicenseExpression:
234235
"License :: OSI Approved :: Zero-Clause BSD (0BSD)": "0BSD",
235236
# multiple versions: ZPL-1.1, ZPL-2.0, ZPL-2.1
236237
"License :: OSI Approved :: Zope Public License": None,
237-
"License :: OSI Approved :: zlib/libpng License": "zlib-acknowledgement",
238+
# zlib-acknowledgement is a different license that is not OSI approved
239+
"License :: OSI Approved :: zlib/libpng License": "Zlib",
238240
"License :: Other/Proprietary License": None,
239241
"License :: Public Domain": None,
240242
"License :: Repoze Public License": None,

‎tests/test_pkgmetadata.py‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ def test_project_urls_from_metadata(
9595
[md(license="MIT and PSF-2.0"), "MIT AND PSF-2.0"],
9696
[md(license="BSD 3-Clause License"), "BSD-3-Clause"],
9797
[md(classifiers=["License :: OSI Approved :: MIT License"]), "MIT"],
98+
# OSI-approved zlib License, not zlib/libpng with Acknowledgement
99+
[md(classifiers=["License :: OSI Approved :: zlib/libpng License"]), "Zlib"],
98100
[
99101
md(
100102
classifiers=[
@@ -117,6 +119,12 @@ def test_license_from_metadata(metadata: Metadata, expected: str) -> None:
117119
(None, None, None),
118120
(None, "invalid", None),
119121
(None, None, ["License :: OSI Approved :: BSD License"]),
122+
# "v3" does not say -only or -or-later, like the GPLv3 classifier
123+
(
124+
None,
125+
None,
126+
["License :: OSI Approved :: GNU Affero General Public License v3"],
127+
),
120128
# classifiers with no entry that maps to SPDX (see issue #1372)
121129
(None, None, ["Programming Language :: Python :: 3"]),
122130
(None, None, ["License :: OSI Approved"]),

0 commit comments

Comments
 (0)