fosslight-source 2.1.15__tar.gz → 2.1.17__tar.gz
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-2.1.15/src/fosslight_source.egg-info → fosslight_source-2.1.17}/PKG-INFO +2 -2
- {fosslight_source-2.1.15 → fosslight_source-2.1.17}/requirements.txt +1 -1
- {fosslight_source-2.1.15 → fosslight_source-2.1.17}/setup.py +1 -1
- {fosslight_source-2.1.15 → fosslight_source-2.1.17}/src/fosslight_source/_help.py +5 -2
- {fosslight_source-2.1.15 → fosslight_source-2.1.17}/src/fosslight_source/_parsing_scancode_file_item.py +56 -3
- {fosslight_source-2.1.15 → fosslight_source-2.1.17}/src/fosslight_source/_scan_item.py +2 -0
- {fosslight_source-2.1.15 → fosslight_source-2.1.17/src/fosslight_source.egg-info}/PKG-INFO +2 -2
- {fosslight_source-2.1.15 → fosslight_source-2.1.17}/src/fosslight_source.egg-info/requires.txt +1 -1
- {fosslight_source-2.1.15 → fosslight_source-2.1.17}/LICENSE +0 -0
- {fosslight_source-2.1.15 → fosslight_source-2.1.17}/MANIFEST.in +0 -0
- {fosslight_source-2.1.15 → fosslight_source-2.1.17}/README.md +0 -0
- {fosslight_source-2.1.15 → fosslight_source-2.1.17}/setup.cfg +0 -0
- {fosslight_source-2.1.15 → fosslight_source-2.1.17}/src/fosslight_source/__init__.py +0 -0
- {fosslight_source-2.1.15 → fosslight_source-2.1.17}/src/fosslight_source/_license_matched.py +0 -0
- {fosslight_source-2.1.15 → fosslight_source-2.1.17}/src/fosslight_source/_parsing_scanoss_file.py +0 -0
- {fosslight_source-2.1.15 → fosslight_source-2.1.17}/src/fosslight_source/cli.py +0 -0
- {fosslight_source-2.1.15 → fosslight_source-2.1.17}/src/fosslight_source/run_scancode.py +0 -0
- {fosslight_source-2.1.15 → fosslight_source-2.1.17}/src/fosslight_source/run_scanoss.py +0 -0
- {fosslight_source-2.1.15 → fosslight_source-2.1.17}/src/fosslight_source/run_spdx_extractor.py +0 -0
- {fosslight_source-2.1.15 → fosslight_source-2.1.17}/src/fosslight_source.egg-info/SOURCES.txt +0 -0
- {fosslight_source-2.1.15 → fosslight_source-2.1.17}/src/fosslight_source.egg-info/dependency_links.txt +0 -0
- {fosslight_source-2.1.15 → fosslight_source-2.1.17}/src/fosslight_source.egg-info/entry_points.txt +0 -0
- {fosslight_source-2.1.15 → fosslight_source-2.1.17}/src/fosslight_source.egg-info/top_level.txt +0 -0
- {fosslight_source-2.1.15 → fosslight_source-2.1.17}/tests/test_tox.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fosslight_source
|
|
3
|
-
Version: 2.1.
|
|
3
|
+
Version: 2.1.17
|
|
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,7 +17,7 @@ License-File: LICENSE
|
|
|
17
17
|
Requires-Dist: pyparsing
|
|
18
18
|
Requires-Dist: scanoss>=1.18.0
|
|
19
19
|
Requires-Dist: XlsxWriter
|
|
20
|
-
Requires-Dist: fosslight_util>=2.1.
|
|
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
|
|
@@ -14,7 +14,7 @@ with open('requirements.txt', 'r', 'utf-8') as f:
|
|
|
14
14
|
if __name__ == "__main__":
|
|
15
15
|
setup(
|
|
16
16
|
name='fosslight_source',
|
|
17
|
-
version='2.1.
|
|
17
|
+
version='2.1.17',
|
|
18
18
|
package_dir={"": "src"},
|
|
19
19
|
packages=find_packages(where='src'),
|
|
20
20
|
description='FOSSLight Source Scanner',
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
# Copyright (c) 2021 LG Electronics Inc.
|
|
4
4
|
# SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
from fosslight_util.help import PrintHelpMsg, print_package_version
|
|
6
|
+
from fosslight_util.output_format import SUPPORT_FORMAT
|
|
6
7
|
|
|
7
|
-
_HELP_MESSAGE_SOURCE_SCANNER = """
|
|
8
|
+
_HELP_MESSAGE_SOURCE_SCANNER = f"""
|
|
8
9
|
FOSSLight Source Scanner Usage: fosslight_source [option1] <arg1> [option2] <arg2>...
|
|
9
10
|
|
|
10
11
|
FOSSLight Source Scanner uses ScanCode and SCANOSS, the source code scanners, to detect
|
|
@@ -20,7 +21,9 @@ _HELP_MESSAGE_SOURCE_SCANNER = """
|
|
|
20
21
|
-m\t\t\t Print additional information for scan result on separate sheets
|
|
21
22
|
-e <path>\t\t Path to exclude from analysis (file and directory)
|
|
22
23
|
-o <output_path>\t Output path (Path or file name)
|
|
23
|
-
-f <format>\t\t Output file formats
|
|
24
|
+
-f <format>\t\t Output file formats
|
|
25
|
+
\t\t\t ({', '.join(SUPPORT_FORMAT)})
|
|
26
|
+
\t\t\t Multiple formats can be specified separated by space.
|
|
24
27
|
Options only for FOSSLight Source Scanner
|
|
25
28
|
-s <scanner>\t Select which scanner to be run (scancode, scanoss, all)
|
|
26
29
|
-j\t\t\t Generate raw result of scanners in json format
|
|
@@ -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:
|
|
@@ -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 = []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fosslight_source
|
|
3
|
-
Version: 2.1.
|
|
3
|
+
Version: 2.1.17
|
|
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,7 +17,7 @@ License-File: LICENSE
|
|
|
17
17
|
Requires-Dist: pyparsing
|
|
18
18
|
Requires-Dist: scanoss>=1.18.0
|
|
19
19
|
Requires-Dist: XlsxWriter
|
|
20
|
-
Requires-Dist: fosslight_util>=2.1.
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fosslight_source-2.1.15 → fosslight_source-2.1.17}/src/fosslight_source/_license_matched.py
RENAMED
|
File without changes
|
{fosslight_source-2.1.15 → fosslight_source-2.1.17}/src/fosslight_source/_parsing_scanoss_file.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fosslight_source-2.1.15 → fosslight_source-2.1.17}/src/fosslight_source/run_spdx_extractor.py
RENAMED
|
File without changes
|
{fosslight_source-2.1.15 → fosslight_source-2.1.17}/src/fosslight_source.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{fosslight_source-2.1.15 → fosslight_source-2.1.17}/src/fosslight_source.egg-info/entry_points.txt
RENAMED
|
File without changes
|
{fosslight_source-2.1.15 → fosslight_source-2.1.17}/src/fosslight_source.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|