diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d27cfd..59b5324 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,11 @@ All major and minor version changes will be documented in this file. Details of patch-level version changes can be found in [commit messages](../../commits/master). +## 2025.1.1 - 2025/10/03 + +- Fixed GNU Library (old alternative license name) not being recognized as LGPL 2.0. +- Added UPL-1.0 license to license types and updated the matrix (similar to MIT). + ## 2025.1.0 - 2025/03/26 - Updated internal machineary diff --git a/licensecheck/license_matrix/__init__.py b/licensecheck/license_matrix/__init__.py index 181b099..bd4c360 100644 --- a/licensecheck/license_matrix/__init__.py +++ b/licensecheck/license_matrix/__init__.py @@ -64,6 +64,7 @@ "MIT": L.MIT, "BSD": L.BSD, "ISC": L.ISC, + "UPL-1.0": L.UPL_1, "NCSA": L.NCSA, "PYTHON": L.PSFL, "PSF-2.0": L.PSFL, @@ -76,6 +77,7 @@ "LGPL-3.0-OR-LATER": L.LGPL_3_PLUS, "LGPL-2.0-ONLY": L.LGPL_2, "LGPLV2": L.LGPL_2, + "GNU LIBRARY": L.LGPL_2, "LGPL-3.0-ONLY": L.LGPL_3, "LGPLV3": L.LGPL_3, "LGPL": L.LGPL_X, diff --git a/licensecheck/license_matrix/matrix.csv b/licensecheck/license_matrix/matrix.csv index 7debcda..83f882f 100644 --- a/licensecheck/license_matrix/matrix.csv +++ b/licensecheck/license_matrix/matrix.csv @@ -1,27 +1,28 @@ -my/deps,PUBLIC,UNLICENSE,MIT,BOOST,BSD,ISC,NCSA,PSFL,APACHE,ECLIPSE,ACADEMIC_FREE,LGPL_X,LGPL_2,LGPL_3,LGPL_2_PLUS,LGPL_3_PLUS,GPL_X,GPL_2,GPL_3,GPL_2_PLUS,GPL_3_PLUS,AGPL_3_PLUS,MPL,EU,PROPRIETARY,NO_LICENSE -PUBLIC,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -UNLICENSE,1,1,0,0,0,0,0,0,0,0,0,0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1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0 +MPL,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0 +EU,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0 +PROPRIETARY,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0 +NO_LICENSE,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0 diff --git a/licensecheck/types.py b/licensecheck/types.py index 8c548ae..abf2247 100644 --- a/licensecheck/types.py +++ b/licensecheck/types.py @@ -70,6 +70,7 @@ class License(Enum): ISC = 13 NCSA = 14 PSFL = 15 + UPL_1 = 16 # Other permissive APACHE = 20 ECLIPSE = 21 diff --git a/tests/test_license_matrix.py b/tests/test_license_matrix.py new file mode 100644 index 0000000..1ca6e14 --- /dev/null +++ b/tests/test_license_matrix.py @@ -0,0 +1,21 @@ +import logging + +import pytest + +from licensecheck.license_matrix import licenseType, ucstr +from licensecheck.types import L + + +@pytest.mark.parametrize("license_string", [ucstr("GNU LIBRARY"), ucstr("UPL-1.0")]) +def test_gnu_library_and_upl_1_is_recognized_without_warnings( + caplog: pytest.LogCaptureFixture, license_string: ucstr +) -> None: + with caplog.at_level(logging.WARNING): + # Correct license where found. + license_type = licenseType(license_string) + assert len(license_type) == 1 + assert isinstance(license_type[0], L) + assert L.UNKNOWN not in license_type + # No warnings were emitted. + if len(caplog.records): + assert license_string not in caplog.text