fosslight-source 2.1.6__tar.gz → 2.1.7__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.6 → fosslight_source-2.1.7}/PKG-INFO +1 -1
- {fosslight_source-2.1.6 → fosslight_source-2.1.7}/requirements.txt +1 -1
- {fosslight_source-2.1.6 → fosslight_source-2.1.7}/setup.py +1 -1
- {fosslight_source-2.1.6 → fosslight_source-2.1.7}/src/fosslight_source/cli.py +8 -4
- {fosslight_source-2.1.6 → fosslight_source-2.1.7}/src/fosslight_source/run_scanoss.py +10 -2
- {fosslight_source-2.1.6 → fosslight_source-2.1.7}/src/fosslight_source.egg-info/PKG-INFO +1 -1
- {fosslight_source-2.1.6 → fosslight_source-2.1.7}/src/fosslight_source.egg-info/requires.txt +1 -1
- {fosslight_source-2.1.6 → fosslight_source-2.1.7}/LICENSE +0 -0
- {fosslight_source-2.1.6 → fosslight_source-2.1.7}/MANIFEST.in +0 -0
- {fosslight_source-2.1.6 → fosslight_source-2.1.7}/README.md +0 -0
- {fosslight_source-2.1.6 → fosslight_source-2.1.7}/setup.cfg +0 -0
- {fosslight_source-2.1.6 → fosslight_source-2.1.7}/src/fosslight_source/__init__.py +0 -0
- {fosslight_source-2.1.6 → fosslight_source-2.1.7}/src/fosslight_source/_help.py +0 -0
- {fosslight_source-2.1.6 → fosslight_source-2.1.7}/src/fosslight_source/_license_matched.py +0 -0
- {fosslight_source-2.1.6 → fosslight_source-2.1.7}/src/fosslight_source/_parsing_scancode_file_item.py +0 -0
- {fosslight_source-2.1.6 → fosslight_source-2.1.7}/src/fosslight_source/_parsing_scanoss_file.py +0 -0
- {fosslight_source-2.1.6 → fosslight_source-2.1.7}/src/fosslight_source/_scan_item.py +0 -0
- {fosslight_source-2.1.6 → fosslight_source-2.1.7}/src/fosslight_source/run_scancode.py +0 -0
- {fosslight_source-2.1.6 → fosslight_source-2.1.7}/src/fosslight_source/run_spdx_extractor.py +0 -0
- {fosslight_source-2.1.6 → fosslight_source-2.1.7}/src/fosslight_source.egg-info/SOURCES.txt +0 -0
- {fosslight_source-2.1.6 → fosslight_source-2.1.7}/src/fosslight_source.egg-info/dependency_links.txt +0 -0
- {fosslight_source-2.1.6 → fosslight_source-2.1.7}/src/fosslight_source.egg-info/entry_points.txt +0 -0
- {fosslight_source-2.1.6 → fosslight_source-2.1.7}/src/fosslight_source.egg-info/top_level.txt +0 -0
|
@@ -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.7',
|
|
18
18
|
package_dir={"": "src"},
|
|
19
19
|
packages=find_packages(where='src'),
|
|
20
20
|
description='FOSSLight Source Scanner',
|
|
@@ -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.)")
|
|
@@ -350,14 +353,15 @@ def run_scanners(
|
|
|
350
353
|
print_matched_text, formats, called_by_cli,
|
|
351
354
|
time_out, correct_mode, correct_filepath)
|
|
352
355
|
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
|
-
|
|
356
|
+
scanoss_result, api_limit_exceed = run_scanoss_py(path_to_scan, output_file_name, formats, True, write_json_file,
|
|
357
|
+
num_cores, path_to_exclude)
|
|
355
358
|
if selected_scanner in SCANNER_TYPE:
|
|
356
359
|
spdx_downloads = get_spdx_downloads(path_to_scan, path_to_exclude)
|
|
357
360
|
merged_result = merge_results(scancode_result, scanoss_result, spdx_downloads)
|
|
358
361
|
scan_item = create_report_file(start_time, merged_result, license_list, scanoss_result, selected_scanner,
|
|
359
362
|
print_matched_text, output_path, output_files, output_extensions, correct_mode,
|
|
360
|
-
correct_filepath, path_to_scan, path_to_exclude, formats, excluded_file_list
|
|
363
|
+
correct_filepath, path_to_scan, path_to_exclude, formats, excluded_file_list,
|
|
364
|
+
api_limit_exceed)
|
|
361
365
|
else:
|
|
362
366
|
print_help_msg_source_scanner()
|
|
363
367
|
result_log[RESULT_KEY] = "Unsupported scanner"
|
|
@@ -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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fosslight_source-2.1.6 → fosslight_source-2.1.7}/src/fosslight_source/_parsing_scanoss_file.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fosslight_source-2.1.6 → fosslight_source-2.1.7}/src/fosslight_source/run_spdx_extractor.py
RENAMED
|
File without changes
|
|
File without changes
|
{fosslight_source-2.1.6 → fosslight_source-2.1.7}/src/fosslight_source.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{fosslight_source-2.1.6 → fosslight_source-2.1.7}/src/fosslight_source.egg-info/entry_points.txt
RENAMED
|
File without changes
|
{fosslight_source-2.1.6 → fosslight_source-2.1.7}/src/fosslight_source.egg-info/top_level.txt
RENAMED
|
File without changes
|