fosslight-source 2.1.6__tar.gz → 2.1.8__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.
Files changed (23) hide show
  1. {fosslight_source-2.1.6 → fosslight_source-2.1.8}/PKG-INFO +1 -1
  2. {fosslight_source-2.1.6 → fosslight_source-2.1.8}/requirements.txt +1 -1
  3. {fosslight_source-2.1.6 → fosslight_source-2.1.8}/setup.py +1 -1
  4. {fosslight_source-2.1.6 → fosslight_source-2.1.8}/src/fosslight_source/cli.py +9 -4
  5. {fosslight_source-2.1.6 → fosslight_source-2.1.8}/src/fosslight_source/run_scanoss.py +10 -2
  6. {fosslight_source-2.1.6 → fosslight_source-2.1.8}/src/fosslight_source.egg-info/PKG-INFO +1 -1
  7. {fosslight_source-2.1.6 → fosslight_source-2.1.8}/src/fosslight_source.egg-info/requires.txt +1 -1
  8. {fosslight_source-2.1.6 → fosslight_source-2.1.8}/LICENSE +0 -0
  9. {fosslight_source-2.1.6 → fosslight_source-2.1.8}/MANIFEST.in +0 -0
  10. {fosslight_source-2.1.6 → fosslight_source-2.1.8}/README.md +0 -0
  11. {fosslight_source-2.1.6 → fosslight_source-2.1.8}/setup.cfg +0 -0
  12. {fosslight_source-2.1.6 → fosslight_source-2.1.8}/src/fosslight_source/__init__.py +0 -0
  13. {fosslight_source-2.1.6 → fosslight_source-2.1.8}/src/fosslight_source/_help.py +0 -0
  14. {fosslight_source-2.1.6 → fosslight_source-2.1.8}/src/fosslight_source/_license_matched.py +0 -0
  15. {fosslight_source-2.1.6 → fosslight_source-2.1.8}/src/fosslight_source/_parsing_scancode_file_item.py +0 -0
  16. {fosslight_source-2.1.6 → fosslight_source-2.1.8}/src/fosslight_source/_parsing_scanoss_file.py +0 -0
  17. {fosslight_source-2.1.6 → fosslight_source-2.1.8}/src/fosslight_source/_scan_item.py +0 -0
  18. {fosslight_source-2.1.6 → fosslight_source-2.1.8}/src/fosslight_source/run_scancode.py +0 -0
  19. {fosslight_source-2.1.6 → fosslight_source-2.1.8}/src/fosslight_source/run_spdx_extractor.py +0 -0
  20. {fosslight_source-2.1.6 → fosslight_source-2.1.8}/src/fosslight_source.egg-info/SOURCES.txt +0 -0
  21. {fosslight_source-2.1.6 → fosslight_source-2.1.8}/src/fosslight_source.egg-info/dependency_links.txt +0 -0
  22. {fosslight_source-2.1.6 → fosslight_source-2.1.8}/src/fosslight_source.egg-info/entry_points.txt +0 -0
  23. {fosslight_source-2.1.6 → fosslight_source-2.1.8}/src/fosslight_source.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fosslight_source
3
- Version: 2.1.6
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
@@ -1,5 +1,5 @@
1
1
  pyparsing
2
- scanoss<=1.14.0
2
+ scanoss>=1.18.0
3
3
  XlsxWriter
4
4
  fosslight_util>=2.1.10
5
5
  PyYAML
@@ -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.6',
17
+ version='2.1.8',
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.)")
@@ -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, num_cores,
354
- path_to_exclude)
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"
@@ -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
- scanner.scan_folder_with_options(scan_dir=path_to_scan)
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.6
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
@@ -1,5 +1,5 @@
1
1
  pyparsing
2
- scanoss<=1.14.0
2
+ scanoss>=1.18.0
3
3
  XlsxWriter
4
4
  fosslight_util>=2.1.10
5
5
  PyYAML