Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions licensecheck/license_matrix/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
55 changes: 28 additions & 27 deletions licensecheck/license_matrix/matrix.csv
Original file line number Diff line number Diff line change
@@ -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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
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
1 change: 1 addition & 0 deletions licensecheck/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ class License(Enum):
ISC = 13
NCSA = 14
PSFL = 15
UPL_1 = 16
# Other permissive
APACHE = 20
ECLIPSE = 21
Expand Down
21 changes: 21 additions & 0 deletions tests/test_license_matrix.py
Original file line number Diff line number Diff line change
@@ -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