fosslight-source 2.1.14__py3-none-any.whl → 2.1.16__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- fosslight_source/_parsing_scancode_file_item.py +56 -3
- fosslight_source/_scan_item.py +7 -2
- {fosslight_source-2.1.14.dist-info → fosslight_source-2.1.16.dist-info}/METADATA +16 -5
- {fosslight_source-2.1.14.dist-info → fosslight_source-2.1.16.dist-info}/RECORD +8 -8
- {fosslight_source-2.1.14.dist-info → fosslight_source-2.1.16.dist-info}/WHEEL +1 -1
- {fosslight_source-2.1.14.dist-info → fosslight_source-2.1.16.dist-info}/entry_points.txt +0 -0
- {fosslight_source-2.1.14.dist-info → fosslight_source-2.1.16.dist-info/licenses}/LICENSE +0 -0
- {fosslight_source-2.1.14.dist-info → fosslight_source-2.1.16.dist-info}/top_level.txt +0 -0
|
@@ -7,6 +7,7 @@ import os
|
|
|
7
7
|
import logging
|
|
8
8
|
import re
|
|
9
9
|
import fosslight_util.constant as constant
|
|
10
|
+
from fosslight_util.get_pom_license import get_license_from_pom
|
|
10
11
|
from ._license_matched import MatchedLicense
|
|
11
12
|
from ._scan_item import SourceItem
|
|
12
13
|
from ._scan_item import is_exclude_dir
|
|
@@ -192,8 +193,34 @@ def parsing_scancode_32_earlier(scancode_file_list: list, has_error: bool = Fals
|
|
|
192
193
|
if len(license_detected) > 0:
|
|
193
194
|
result_item.licenses = license_detected
|
|
194
195
|
|
|
195
|
-
|
|
196
|
+
detected_without_pom = []
|
|
197
|
+
if is_manifest_file(file_path) and len(license_detected) > 0:
|
|
196
198
|
result_item.is_manifest_file = True
|
|
199
|
+
if file_path.endswith('.pom'):
|
|
200
|
+
try:
|
|
201
|
+
pom_licenses = get_license_from_pom(pom_path=file_path, check_parent=False)
|
|
202
|
+
normalize_pom_licenses = []
|
|
203
|
+
if pom_licenses:
|
|
204
|
+
pom_license_list = pom_licenses.split(', ')
|
|
205
|
+
for pom_license in pom_license_list:
|
|
206
|
+
if pom_license not in license_detected:
|
|
207
|
+
for lic_matched_key, lic_info in license_list.items():
|
|
208
|
+
if hasattr(lic_info, 'matched_text') and lic_info.matched_text:
|
|
209
|
+
matched_txt = str(lic_info.matched_text).replace(',', '')
|
|
210
|
+
if pom_license in matched_txt:
|
|
211
|
+
normalize_pom_licenses.append(lic_info.license)
|
|
212
|
+
break
|
|
213
|
+
else:
|
|
214
|
+
normalize_pom_licenses.append(pom_license)
|
|
215
|
+
detected_without_pom = list(set(license_detected) - set(normalize_pom_licenses))
|
|
216
|
+
if detected_without_pom:
|
|
217
|
+
result_item.comment = f"Detected: {', '.join(detected_without_pom)}"
|
|
218
|
+
result_item.licenses = []
|
|
219
|
+
result_item.licenses = normalize_pom_licenses
|
|
220
|
+
if not normalize_pom_licenses:
|
|
221
|
+
result_item.exclude = True
|
|
222
|
+
except Exception as ex:
|
|
223
|
+
logger.info(f"Failed to extract license from POM {file_path}: {ex}")
|
|
197
224
|
|
|
198
225
|
# Remove copyright info for license text file of GPL family
|
|
199
226
|
if should_remove_copyright_for_gpl_license_text(license_detected, result_item.is_license_text):
|
|
@@ -202,7 +229,7 @@ def parsing_scancode_32_earlier(scancode_file_list: list, has_error: bool = Fals
|
|
|
202
229
|
else:
|
|
203
230
|
result_item.copyright = copyright_value_list
|
|
204
231
|
|
|
205
|
-
if len(license_expression_list) > 0:
|
|
232
|
+
if len(license_expression_list) > 0 and not detected_without_pom:
|
|
206
233
|
license_expression_list = list(
|
|
207
234
|
set(license_expression_list))
|
|
208
235
|
result_item.comment = ','.join(license_expression_list)
|
|
@@ -307,8 +334,34 @@ def parsing_scancode_32_later(
|
|
|
307
334
|
result_item.exclude = is_exclude_file(file_path)
|
|
308
335
|
result_item.is_license_text = file.get("percentage_of_license_text", 0) > 90 or is_notice_file(file_path)
|
|
309
336
|
|
|
337
|
+
detected_without_pom = []
|
|
310
338
|
if is_manifest_file(file_path) and len(license_detected) > 0:
|
|
311
339
|
result_item.is_manifest_file = True
|
|
340
|
+
if file_path.endswith('.pom'):
|
|
341
|
+
try:
|
|
342
|
+
pom_licenses = get_license_from_pom(pom_path=file_path, check_parent=False)
|
|
343
|
+
normalize_pom_licenses = []
|
|
344
|
+
if pom_licenses:
|
|
345
|
+
pom_license_list = pom_licenses.split(', ')
|
|
346
|
+
for pom_license in pom_license_list:
|
|
347
|
+
if pom_license not in license_detected:
|
|
348
|
+
for lic_matched_key, lic_info in license_list.items():
|
|
349
|
+
if hasattr(lic_info, 'matched_text') and lic_info.matched_text:
|
|
350
|
+
matched_txt = str(lic_info.matched_text).replace(',', '')
|
|
351
|
+
if pom_license in matched_txt:
|
|
352
|
+
normalize_pom_licenses.append(lic_info.license)
|
|
353
|
+
break
|
|
354
|
+
else:
|
|
355
|
+
normalize_pom_licenses.append(pom_license)
|
|
356
|
+
detected_without_pom = list(set(license_detected) - set(normalize_pom_licenses))
|
|
357
|
+
if detected_without_pom:
|
|
358
|
+
result_item.comment = f"Detected: {', '.join(detected_without_pom)}"
|
|
359
|
+
result_item.licenses = []
|
|
360
|
+
result_item.licenses = normalize_pom_licenses
|
|
361
|
+
if not normalize_pom_licenses:
|
|
362
|
+
result_item.exclude = True
|
|
363
|
+
except Exception as ex:
|
|
364
|
+
logger.info(f"Failed to extract license from POM {file_path}: {ex}")
|
|
312
365
|
|
|
313
366
|
# Remove copyright info for license text file of GPL family
|
|
314
367
|
if should_remove_copyright_for_gpl_license_text(license_detected, result_item.is_license_text):
|
|
@@ -317,7 +370,7 @@ def parsing_scancode_32_later(
|
|
|
317
370
|
else:
|
|
318
371
|
result_item.copyright = copyright_value_list
|
|
319
372
|
|
|
320
|
-
if len(license_detected) > 1:
|
|
373
|
+
if len(license_detected) > 1 and not detected_without_pom:
|
|
321
374
|
license_expression_spdx = file.get("detected_license_expression_spdx", "")
|
|
322
375
|
license_expression = file.get("detected_license_expression", "")
|
|
323
376
|
if license_expression_spdx:
|
fosslight_source/_scan_item.py
CHANGED
|
@@ -74,6 +74,8 @@ class SourceItem(FileItem):
|
|
|
74
74
|
break
|
|
75
75
|
if max_length_exceed and (SUBSTRING_LICENSE_COMMENT not in self.comment):
|
|
76
76
|
self.comment = f"{self.comment}/ {SUBSTRING_LICENSE_COMMENT}" if self.comment else SUBSTRING_LICENSE_COMMENT
|
|
77
|
+
else:
|
|
78
|
+
self._licenses = value
|
|
77
79
|
|
|
78
80
|
def set_oss_item(self) -> None:
|
|
79
81
|
self.oss_items = []
|
|
@@ -151,10 +153,13 @@ def is_manifest_file(file_path: str) -> bool:
|
|
|
151
153
|
|
|
152
154
|
|
|
153
155
|
def is_package_dir(dir_path: str) -> bool:
|
|
154
|
-
|
|
156
|
+
# scancode and scanoss use '/' as path separator regardless of OS
|
|
157
|
+
dir_path = dir_path.replace('\\', '/')
|
|
158
|
+
path_parts = dir_path.split('/')
|
|
159
|
+
|
|
155
160
|
for pkg_dir in _package_directory:
|
|
156
161
|
if pkg_dir in path_parts:
|
|
157
162
|
pkg_index = path_parts.index(pkg_dir)
|
|
158
|
-
pkg_path =
|
|
163
|
+
pkg_path = '/'.join(path_parts[:pkg_index + 1])
|
|
159
164
|
return True, pkg_path
|
|
160
165
|
return False, ""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
2
|
-
Name:
|
|
3
|
-
Version: 2.1.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: fosslight_source
|
|
3
|
+
Version: 2.1.16
|
|
4
4
|
Summary: FOSSLight Source Scanner
|
|
5
5
|
Home-page: https://github.com/fosslight/fosslight_source_scanner
|
|
6
6
|
Download-URL: https://github.com/fosslight/fosslight_source_scanner
|
|
@@ -17,15 +17,26 @@ License-File: LICENSE
|
|
|
17
17
|
Requires-Dist: pyparsing
|
|
18
18
|
Requires-Dist: scanoss>=1.18.0
|
|
19
19
|
Requires-Dist: XlsxWriter
|
|
20
|
-
Requires-Dist:
|
|
20
|
+
Requires-Dist: fosslight_util>=2.1.30
|
|
21
21
|
Requires-Dist: PyYAML
|
|
22
22
|
Requires-Dist: wheel>=0.38.1
|
|
23
23
|
Requires-Dist: intbitset
|
|
24
|
-
Requires-Dist:
|
|
24
|
+
Requires-Dist: fosslight_binary>=5.0.0
|
|
25
25
|
Requires-Dist: scancode-toolkit>=32.0.2
|
|
26
26
|
Requires-Dist: fingerprints==1.2.3
|
|
27
27
|
Requires-Dist: normality==2.6.1
|
|
28
28
|
Requires-Dist: click==8.2.1
|
|
29
|
+
Dynamic: author
|
|
30
|
+
Dynamic: classifier
|
|
31
|
+
Dynamic: description
|
|
32
|
+
Dynamic: description-content-type
|
|
33
|
+
Dynamic: download-url
|
|
34
|
+
Dynamic: home-page
|
|
35
|
+
Dynamic: license
|
|
36
|
+
Dynamic: license-file
|
|
37
|
+
Dynamic: requires-dist
|
|
38
|
+
Dynamic: requires-python
|
|
39
|
+
Dynamic: summary
|
|
29
40
|
|
|
30
41
|
<!--
|
|
31
42
|
Copyright (c) 2021 LG Electronics
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
fosslight_source/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
2
|
fosslight_source/_help.py,sha256=q3eKABhBrz8hvWSvmLVszStNpL18TCYLnUuefaU4V-M,2013
|
|
3
3
|
fosslight_source/_license_matched.py,sha256=-3H881XQjFDafRttBsuboS3VbCPYEvPH1pwWXptknE4,2164
|
|
4
|
-
fosslight_source/_parsing_scancode_file_item.py,sha256=
|
|
4
|
+
fosslight_source/_parsing_scancode_file_item.py,sha256=DA2tEbjCHXFLfavCh0TjRIF1-dE4Ep7X2ivDF8IJqS8,20227
|
|
5
5
|
fosslight_source/_parsing_scanoss_file.py,sha256=0f5JzjnFU-kcPZRX7OKnextyvANjKwwNZeyCJVC7eME,4624
|
|
6
|
-
fosslight_source/_scan_item.py,sha256=
|
|
6
|
+
fosslight_source/_scan_item.py,sha256=9bm1kOeBudIb2M8wmmRKAzOFdkdBTUtoyO2LQKaJeDQ,6584
|
|
7
7
|
fosslight_source/cli.py,sha256=2TuHZvDKUp8R12DM9gesTF23RT7OBw968AdzNLtVanU,16650
|
|
8
8
|
fosslight_source/run_scancode.py,sha256=YSzLoS4p-Kge91uQpI4483ZfiapF-3umgJHggxKtiuU,7220
|
|
9
9
|
fosslight_source/run_scanoss.py,sha256=8wu3sa-YBqjfb5x2dbDJuAdw3rrExueOW23WdzqDCaU,5721
|
|
10
10
|
fosslight_source/run_spdx_extractor.py,sha256=Hr9sTv06cJaVITy8amwexIW2FV8_rUcFw6hKmR9ZYws,1990
|
|
11
|
-
fosslight_source-2.1.
|
|
12
|
-
fosslight_source-2.1.
|
|
13
|
-
fosslight_source-2.1.
|
|
14
|
-
fosslight_source-2.1.
|
|
15
|
-
fosslight_source-2.1.
|
|
16
|
-
fosslight_source-2.1.
|
|
11
|
+
fosslight_source-2.1.16.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
12
|
+
fosslight_source-2.1.16.dist-info/METADATA,sha256=tUk55VzoNMOBArqLGuZoHyCoY4IXCqmIoqY2NvX1344,3558
|
|
13
|
+
fosslight_source-2.1.16.dist-info/WHEEL,sha256=SmOxYU7pzNKBqASvQJ7DjX3XGUF92lrGhMb3R6_iiqI,91
|
|
14
|
+
fosslight_source-2.1.16.dist-info/entry_points.txt,sha256=G4bBRWqSrJ68g-2M-JtNDrSZsdym_M7_KohQ2qR1vG8,113
|
|
15
|
+
fosslight_source-2.1.16.dist-info/top_level.txt,sha256=C2vw-0OIent84Vq-UEk1gt_kK1EL8dIItzBzp3WNyA4,17
|
|
16
|
+
fosslight_source-2.1.16.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|