Skip to content

Commit 76c912a

Browse files
committed
Fixed bug with GNU Library being not rec
ognized and added UPL-1.0 license.
1 parent bcbcac2 commit 76c912a

5 files changed

Lines changed: 57 additions & 27 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
All major and minor version changes will be documented in this file. Details of
44
patch-level version changes can be found in [commit messages](../../commits/master).
55

6+
## 2025.1.1 - 2025/10/03
7+
8+
- Fixed GNU Library (old alternative license name) not being recognized as LGPL 2.0.
9+
- Added UPL-1.0 license to license types and updated the matrix (similar to MIT).
10+
611
## 2025.1.0 - 2025/03/26
712

813
- Updated internal machineary

licensecheck/license_matrix/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
"MIT": L.MIT,
6565
"BSD": L.BSD,
6666
"ISC": L.ISC,
67+
"UPL-1.0": L.UPL_1,
6768
"NCSA": L.NCSA,
6869
"PYTHON": L.PSFL,
6970
"PSF-2.0": L.PSFL,
@@ -76,6 +77,7 @@
7677
"LGPL-3.0-OR-LATER": L.LGPL_3_PLUS,
7778
"LGPL-2.0-ONLY": L.LGPL_2,
7879
"LGPLV2": L.LGPL_2,
80+
"GNU LIBRARY": L.LGPL_2,
7981
"LGPL-3.0-ONLY": L.LGPL_3,
8082
"LGPLV3": L.LGPL_3,
8183
"LGPL": L.LGPL_X,
Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
1-
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
2-
PUBLIC,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,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1,1,1,1,1,1,1,1,1,0,0,0,1,1,0,1,0,1,1,0,1,0,0,1,1,0,0
23+
GPL_3_PLUS,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,0,0,1,1,1,0,1,1,0,0
24+
AGPL_3_PLUS,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0
25+
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
26+
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
27+
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
28+
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

licensecheck/types.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ class License(Enum):
7070
ISC = 13
7171
NCSA = 14
7272
PSFL = 15
73+
UPL_1 = 16
7374
# Other permissive
7475
APACHE = 20
7576
ECLIPSE = 21

tests/test_license_matrix.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import logging
2+
3+
import pytest
4+
5+
from licensecheck.license_matrix import licenseType, ucstr
6+
from licensecheck.types import L
7+
8+
9+
@pytest.mark.parametrize("license_string", [ucstr("GNU LIBRARY"), ucstr("UPL-1.0")])
10+
def test_gnu_library_and_upl_1_is_recognized_without_warnings(
11+
caplog: pytest.LogCaptureFixture, license_string: ucstr
12+
) -> None:
13+
with caplog.at_level(logging.WARNING):
14+
# Correct license where found.
15+
license_type = licenseType(license_string)
16+
assert len(license_type) == 1
17+
assert isinstance(license_type[0], L)
18+
assert L.UNKNOWN not in license_type
19+
# No warnings were emitted.
20+
if len(caplog.records):
21+
assert license_string not in caplog.text

0 commit comments

Comments
 (0)