fosslight-source 2.1.6__py3-none-any.whl → 2.1.8__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/cli.py +9 -4
- fosslight_source/run_scanoss.py +10 -2
- {fosslight_source-2.1.6.dist-info → fosslight_source-2.1.8.dist-info}/METADATA +2 -2
- {fosslight_source-2.1.6.dist-info → fosslight_source-2.1.8.dist-info}/RECORD +8 -8
- {fosslight_source-2.1.6.dist-info → fosslight_source-2.1.8.dist-info}/LICENSE +0 -0
- {fosslight_source-2.1.6.dist-info → fosslight_source-2.1.8.dist-info}/WHEEL +0 -0
- {fosslight_source-2.1.6.dist-info → fosslight_source-2.1.8.dist-info}/entry_points.txt +0 -0
- {fosslight_source-2.1.6.dist-info → fosslight_source-2.1.8.dist-info}/top_level.txt +0 -0
fosslight_source/cli.py
CHANGED
|
@@ -148,7 +148,7 @@ def create_report_file(
|
|
|
148
148
|
output_path: str = "", output_files: list = [],
|
|
149
149
|
output_extensions: list = [], correct_mode: bool = True,
|
|
150
150
|
correct_filepath: str = "", path_to_scan: str = "", path_to_exclude: list = [],
|
|
151
|
-
formats: list = [], excluded_file_list: list = []
|
|
151
|
+
formats: list = [], excluded_file_list: list = [], api_limit_exceed: bool = False
|
|
152
152
|
) -> 'ScannerItem':
|
|
153
153
|
"""
|
|
154
154
|
Create report files for given scanned result.
|
|
@@ -212,6 +212,9 @@ def create_report_file(
|
|
|
212
212
|
scan_item.set_cover_comment(f"Total number of files : {files_count}")
|
|
213
213
|
scan_item.set_cover_comment(f"Removed files : {removed_files_count}")
|
|
214
214
|
|
|
215
|
+
if api_limit_exceed:
|
|
216
|
+
scan_item.set_cover_comment("(Some of) SCANOSS scan was skipped. (API limits being exceeded)")
|
|
217
|
+
|
|
215
218
|
if not merged_result:
|
|
216
219
|
if files_count < 1:
|
|
217
220
|
scan_item.set_cover_comment("(No file detected.)")
|
|
@@ -332,6 +335,7 @@ def run_scanners(
|
|
|
332
335
|
spdx_downloads = {}
|
|
333
336
|
result_log = {}
|
|
334
337
|
scan_item = []
|
|
338
|
+
api_limit_exceed = False
|
|
335
339
|
|
|
336
340
|
success, msg, output_path, output_files, output_extensions, formats = check_output_formats_v2(output_file_name, formats)
|
|
337
341
|
|
|
@@ -350,14 +354,15 @@ def run_scanners(
|
|
|
350
354
|
print_matched_text, formats, called_by_cli,
|
|
351
355
|
time_out, correct_mode, correct_filepath)
|
|
352
356
|
if selected_scanner == 'scanoss' or selected_scanner == 'all' or selected_scanner == '':
|
|
353
|
-
scanoss_result = run_scanoss_py(path_to_scan, output_file_name, formats, True, write_json_file,
|
|
354
|
-
|
|
357
|
+
scanoss_result, api_limit_exceed = run_scanoss_py(path_to_scan, output_file_name, formats, True, write_json_file,
|
|
358
|
+
num_cores, path_to_exclude)
|
|
355
359
|
if selected_scanner in SCANNER_TYPE:
|
|
356
360
|
spdx_downloads = get_spdx_downloads(path_to_scan, path_to_exclude)
|
|
357
361
|
merged_result = merge_results(scancode_result, scanoss_result, spdx_downloads)
|
|
358
362
|
scan_item = create_report_file(start_time, merged_result, license_list, scanoss_result, selected_scanner,
|
|
359
363
|
print_matched_text, output_path, output_files, output_extensions, correct_mode,
|
|
360
|
-
correct_filepath, path_to_scan, path_to_exclude, formats, excluded_file_list
|
|
364
|
+
correct_filepath, path_to_scan, path_to_exclude, formats, excluded_file_list,
|
|
365
|
+
api_limit_exceed)
|
|
361
366
|
else:
|
|
362
367
|
print_help_msg_source_scanner()
|
|
363
368
|
result_log[RESULT_KEY] = "Unsupported scanner"
|
fosslight_source/run_scanoss.py
CHANGED
|
@@ -17,6 +17,8 @@ from ._parsing_scanoss_file import parsing_extraInfo # scanoss
|
|
|
17
17
|
import shutil
|
|
18
18
|
from pathlib import Path
|
|
19
19
|
from scanoss.scanner import Scanner, ScanType
|
|
20
|
+
import io
|
|
21
|
+
import contextlib
|
|
20
22
|
|
|
21
23
|
logger = logging.getLogger(constant.LOGGER_NAME)
|
|
22
24
|
warnings.filterwarnings("ignore", category=FutureWarning)
|
|
@@ -75,7 +77,13 @@ def run_scanoss_py(path_to_scan: str, output_file_name: str = "", format: list =
|
|
|
75
77
|
scan_options=ScanType.SCAN_SNIPPETS.value,
|
|
76
78
|
nb_threads=num_threads if num_threads > 0 else 10
|
|
77
79
|
)
|
|
78
|
-
|
|
80
|
+
|
|
81
|
+
output_buffer = io.StringIO()
|
|
82
|
+
with contextlib.redirect_stdout(output_buffer), contextlib.redirect_stderr(output_buffer):
|
|
83
|
+
scanner.scan_folder_with_options(scan_dir=path_to_scan)
|
|
84
|
+
captured_output = output_buffer.getvalue()
|
|
85
|
+
api_limit_exceed = "due to service limits being exceeded" in captured_output
|
|
86
|
+
logger.debug(f"{captured_output}")
|
|
79
87
|
|
|
80
88
|
if os.path.isfile(output_json_file):
|
|
81
89
|
total_files_to_excluded = []
|
|
@@ -117,4 +125,4 @@ def run_scanoss_py(path_to_scan: str, output_file_name: str = "", format: list =
|
|
|
117
125
|
except Exception as error:
|
|
118
126
|
logger.debug(f"Moving scanoss raw files failed.: {error}")
|
|
119
127
|
|
|
120
|
-
return scanoss_file_list
|
|
128
|
+
return scanoss_file_list, api_limit_exceed
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: fosslight-source
|
|
3
|
-
Version: 2.1.
|
|
3
|
+
Version: 2.1.8
|
|
4
4
|
Summary: FOSSLight Source Scanner
|
|
5
5
|
Home-page: https://github.com/fosslight/fosslight_source_scanner
|
|
6
6
|
Author: LG Electronics
|
|
@@ -16,7 +16,7 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
16
16
|
Requires-Python: >=3.8
|
|
17
17
|
Description-Content-Type: text/markdown
|
|
18
18
|
Requires-Dist: pyparsing
|
|
19
|
-
Requires-Dist: scanoss
|
|
19
|
+
Requires-Dist: scanoss>=1.18.0
|
|
20
20
|
Requires-Dist: XlsxWriter
|
|
21
21
|
Requires-Dist: fosslight-util>=2.1.10
|
|
22
22
|
Requires-Dist: PyYAML
|
|
@@ -4,13 +4,13 @@ fosslight_source/_license_matched.py,sha256=-3H881XQjFDafRttBsuboS3VbCPYEvPH1pwW
|
|
|
4
4
|
fosslight_source/_parsing_scancode_file_item.py,sha256=4U8wTuuNm-2-hanTxiQr2FvHTBrf2ZwESyea_E8caHU,13466
|
|
5
5
|
fosslight_source/_parsing_scanoss_file.py,sha256=Ss6BWTdT1Q43xTT9GBwL6XyzHT2p57ymVm04NL76Vbg,4506
|
|
6
6
|
fosslight_source/_scan_item.py,sha256=2RdnH5ZvrD7yjGxaHAIgSLmhq0dyW1379RScqPYJtOI,5679
|
|
7
|
-
fosslight_source/cli.py,sha256=
|
|
7
|
+
fosslight_source/cli.py,sha256=mF5F1vCfiMLeL700r-grhFAG-rGS4_xisDCnrJFHxic,16668
|
|
8
8
|
fosslight_source/run_scancode.py,sha256=leq-FuGwX-kBg-sNZXQ-DSKy-uTj7w2QBFeOLgyvPxc,7094
|
|
9
|
-
fosslight_source/run_scanoss.py,sha256=
|
|
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.8.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
12
|
+
fosslight_source-2.1.8.dist-info/METADATA,sha256=YJaCaiPsrxgeimPYJK6aec6HhIK93zTLCV11aWnRC50,3433
|
|
13
|
+
fosslight_source-2.1.8.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
|
14
|
+
fosslight_source-2.1.8.dist-info/entry_points.txt,sha256=NzFURHC4L8uf1PmnZ2uGQcZxR7UbYCgjetb_9aPHV-w,114
|
|
15
|
+
fosslight_source-2.1.8.dist-info/top_level.txt,sha256=C2vw-0OIent84Vq-UEk1gt_kK1EL8dIItzBzp3WNyA4,17
|
|
16
|
+
fosslight_source-2.1.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|